About this tool
Convert literal text to HTML character references, or turn character references back into readable text. Encoding covers ampersands, angle brackets, and both quote characters. Decoding supports complete named and numeric entities through the browser’s HTML decoder.
How to use
- Choose Encode text or Decode entities.
- Paste input or load a sample. When encoding, optionally enable non-ASCII character encoding.
- Select the conversion button. Review, copy, or download the plain-text result.
Escaping the five special characters
Encoding replaces & with &, < with <, > with >, double quotes with ", and apostrophes with '. For example, A & B becomes A & B. Existing entity text is encoded again: & becomes &amp;. This is intentional because the input is treated as literal text.
Unicode and numeric character references
The optional non-ASCII setting converts characters beyond ASCII to decimal references. Emoji are handled as Unicode code points, so a character outside the basic multilingual plane becomes one reference rather than two surrogate halves. Decoding accepts decimal references such as ©, hexadecimal references such as ©, and named references such as ©.
Decode one layer at a time
Only complete references ending in a semicolon are decoded. Unknown names remain unchanged. &lt; becomes < after one pass, rather than a less-than sign. The browser resolves each isolated entity token; the surrounding input is never inserted as markup. Both input and output remain plain text, including any script-like text.
Choose escaping for the destination
This tool is useful for documentation examples, debugging escaped API text, and preparing literal text for HTML. It is not an HTML sanitizer, JavaScript escaper, or CSS escaper, and it does not validate links. Follow the destination application’s context-specific encoding rules. Processing stays in this browser and the tool does not save your pasted text.
Continue this workflow
Use the adjacent tool when the next step calls for a different input, output, or method.
Assumptions and limitations
- Maximum input: 200,000 characters.
- A semicolon is required when decoding; legacy semicolon-free references are intentionally left unchanged.
- Decoding processes one layer only. Unknown names stay as written; invalid numeric references follow browser replacement rules.
- This is not a sanitizer or an XSS scanner. Do not treat decoded markup as safe to execute.
Sources and standards
These authoritative references were used to verify the method and guidance on this page.
Frequently asked questions
Will decoding execute HTML or scripts?
No. The output is displayed in a read-only text area. Only isolated character-reference tokens are passed to the browser decoder.
Why did &lt; not become a less-than sign?
The tool decodes one layer per operation. &lt; becomes <. Copy that result into the input and decode again if a second layer is intended.
Can it encode emoji and accented letters?
Yes. Enable Also encode non-ASCII characters to produce decimal references for those characters. Without it, they remain unchanged.
Is HTML encoding the same as URL encoding?
No. HTML uses character references such as &, while URL component encoding uses percent sequences such as %26. Use the encoder appropriate to the destination.