How HTML Entity Decoding Works
Paste HTML character references to recover their characters. The decoded output is text for inspection and copying. Decoding is not sanitization and should not be used as permission to insert the result into a live page.
Named and Numeric Entities
Named entities identify characters by name, while decimal and hexadecimal references identify code points. Proper semicolons make parsing less ambiguous. The browser’s HTML parser determines how supported references are interpreted.
HTML Decode Examples
& decodes to an ampersand and ' to an apostrophe. Decoding <script> produces angle-bracket markup text; treat that result as untrusted source rather than executable content.
HTML Decode vs URL Decode
HTML entity decoding handles references used in markup. URL decoding interprets percent escapes. A string can contain both layers, and each should be decoded only in the context required by the application.
Handling Unicode Entities
Unicode references can represent symbols outside ASCII. Inspect replacement characters or unexpected whitespace when the input has invalid references. Decoding does not normalize all visually similar characters.
More examples and technical details
How HTML Decoding Works
Decoding walks the text looking for an ampersand. When it finds one it reads forward to the next semicolon and inspects what sits between them. If the content is a known entity name it substitutes that character. If it begins with a hash it is a numeric reference, and the digits are read as a Unicode code point. If it begins with a hash followed by x it is hexadecimal. Anything that does not match a valid pattern is left exactly as it was found.
Worked Example
A product title pulled from a feed often arrives with everything escaped, including characters that never needed it.
If the source was double encoded you will see &amp; in the input and a single & in the output. Decoding again gives the literal ampersand, and the presence of that pattern tells you an upstream pipeline is escaping twice.
Where You Meet Encoded HTML
- Scraped pages. Extracting text from markup leaves entities behind unless the scraper resolves them.
- RSS and Atom feeds. Titles and descriptions are escaped so they can sit inside XML elements, frequently twice.
- Database columns. Legacy applications that escaped on write rather than on render leave entities baked into stored rows forever.
- JSON API responses. Fields destined for a web page are often pre-escaped by the server, which breaks mobile clients that render plain text.
- HTML email. Marketing tooling escapes aggressively, and the raw source is full of and numeric references.
- CSV exports. Text pulled from a CMS and dumped to CSV keeps its entities and looks broken in a spreadsheet.
Decoding Reintroduces Risk
If you do need to render decoded content as markup, run it through a sanitiser that works on the parsed tree and allows only a known list of elements and attributes. Filtering with regular expressions is not sufficient, because the HTML parser accepts far more variations than any pattern will anticipate.
HTML Entity Reference Table
Named entities are easier to read, numeric entities work everywhere including XML where only five names are predefined. Both forms always end with a semicolon.
| Character | Named entity | Numeric entity | Description |
|---|---|---|---|
| & | & | & | Ampersand |
| < | < | < | Less than, opens a tag |
| > | > | > | Greater than, closes a tag |
| " | " | " | Double quotation mark |
| ' | ' | ' | Apostrophe or single quote |
| (space) | |   | Non-breaking space |
| © | © | © | Copyright sign |
| ® | ® | ® | Registered trademark sign |
| ™ | ™ | ™ | Trademark sign |
| – | – | – | En dash |
| … | … | … | Horizontal ellipsis |
| € | € | € | Euro sign |
| £ | £ | £ | Pound sign |
| ° | ° | ° | Degree sign |
| × | × | × | Multiplication sign |
Working on something related? Browse every free developer tool on the site, including a HTML encoder, URL decoder, Base64 decoder, and text utilities. Everything runs entirely in your browser, so nothing you paste is ever uploaded.
Frequently asked questions
How do I decode HTML entities?
Paste the entity-encoded string in Decode mode and copy the characters.
Can it decode numeric entities?
Yes. Decimal and hexadecimal numeric references are supported by browser parsing.
What is the difference between HTML and URL decoding?
HTML decoding resolves character references; URL decoding resolves percent escapes.
Can decoded HTML contain markup?
Yes. The decoded text may contain markup, so do not inject it unsafely into HTML.
Is text uploaded?
No. Input is processed in this browser tab and is not uploaded by the tool. Copy and download are actions you control; ordinary page analytics do not receive tool input.