HTML entity encoder & decoder — escape and unescape text
Encode HTML special characters or decode named, decimal and hexadecimal entities. Unicode support, copy and TXT download. Free, private and browser-only.
Paste text, choose Encode or Decode, and convert. Encode escapes ampersands, angle brackets and both quote marks. Choose ASCII output to also encode non-ASCII characters. Copy, download as TXT, or use the result as input to reverse the direction. Ctrl/Command + Enter converts from the input box.
Good to know
Up to 500,000 UTF-16 code units per input. Decoding requires semicolons, is case-sensitive and runs once; unknown names and incomplete references remain unchanged. Invalid numeric code points become the replacement character; legacy numeric references follow HTML mappings. Encoding rejects nulls and unpaired surrogates; ASCII mode also rejects legacy control characters that would change when decoded. Text stays in your browser and is not saved.
It replaces characters with references that HTML interprets as characters. For example, < becomes < and & becomes &. Use this when displaying literal markup in HTML text or preparing text for quoted attribute values; it does not validate URLs or sanitize HTML.
The decoder deliberately processes one layer at a time. Use the result as input, select Decode again and convert to remove another layer. Repeated automatic decoding could change text you intended to keep. Encoding always treats the input as literal text, including existing references.
Does decoding remove HTML tags or run scripts?
No. Tags remain text, and nothing is rendered or executed. The output is not sanitized: use appropriate validation and escaping before inserting it into a website.
Why are some entities unchanged or replaced?
Names are case-sensitive and must end with a semicolon. Unknown names and malformed references are kept. Numeric zero, surrogate values and numbers above U+10FFFF become �; legacy numeric codes such as € map to € under HTML rules.
How do I encode emoji and Arabic text?
Special-characters-only mode leaves Unicode readable. ASCII output uses hexadecimal numeric references for non-ASCII code points, so 🙂 becomes 🙂. Combining marks are handled as separate code points.