HTML entity encoder and decoder
Encode special HTML characters, or decode named and numeric references as plain text.
- 1Add input
- 2Adjust settings
- 3Get your result
Tool input and files are processed in this browser without being uploaded.
Before you start
Encode &, <, > and quotation marks as HTML character references, or turn supported named and numeric references back into readable characters. Conversion happens in your browser, and the result is displayed as plain text.
How to use this tool
- Paste the text or HTML character references into Text. Under Options, choose Encode or Decode in Operation.
- When encoding, enable Encode non-ASCII characters too if you also want characters such as accented letters or emoji written as numeric references. This option is hidden when decoding.
- Select Convert HTML entities and review the text. Use Copy result for the complete output or download result.txt. Convert again after changing the input or options.
Supported inputs and limits
Paste up to 1 MiB of text, measured in UTF-8 bytes. This tool has no file input.
Decoding requires a closing semicolon. Unknown names and references without a semicolon stay unchanged. Recognized numeric references with a value of zero, a surrogate code point or a value above U+10FFFF cause an error.
Some numeric references use HTML's legacy C1 mapping: € decodes to €. Their results can differ from treating the number as a Unicode code point directly.
Encoding does not preserve existing references: their ampersands are escaped again. Choose Decode when you want references converted back into characters.
Worked example
Example input
<a>&"
Example options
{}Example output
<a>&"
When something does not work
If a reference stays unchanged, check its name, letter case and closing semicolon. Correct invalid numeric values in the original text before trying again. Review nested references before decoding a result a second time. Editing the input marks the previous result as stale, and a failed run clears it. Copy or download any result you need before refreshing or closing the tab.
Frequently asked questions
Why do some references stay unchanged?
The decoder looks for supported, semicolon-terminated names and decimal or hexadecimal numeric references. Named references are case-sensitive. It leaves unknown names and text outside those forms as written. It also decodes only once: &lt; becomes <, rather than a less-than sign.
Can decoded HTML run in the result?
No. The result is displayed as plain text, even when it contains tags or scripts, and the download is a text file. This conversion does not validate HTML or sanitize it for insertion into a page; check how the destination will interpret the text.
Documentation & further reading
Related tools
Base64 encoder and decoder
Encode text or file bytes as Base64, or decode Base64 to UTF-8 text or a binary file.
URL encoder and decoder
Percent-encode or decode a URL component or whole URL, with optional plus-to-space decoding.
Unicode escape converter
Convert text to Unicode escapes or decode supported JavaScript-style escapes into readable text.
SHA-256 checksum
Calculate a SHA-256 checksum for text or a file.