HTML Encode
Encode special characters into safe HTML entities.
Convert HTML entities like the encoded ampersand and angle brackets back into their original characters, decoding both named entities and numeric character references. Everything runs 100% client-side in your browser.
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.
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 & 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.
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.
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.
Scraped pages, exported database fields, RSS feeds, and API responses often arrive with their text still HTML encoded, full of entities that make the content hard to read. This HTML decoder reverses that encoding: it recognizes named entities, decimal numeric references, and hexadecimal references, and rewrites every one of them back to its original character in a single pass. It is ideal for cleaning up scraped content, inspecting encoded email bodies, and turning escaped markup back into readable text. Because it runs entirely in your browser, none of the text you decode ever leaves your device.