HTML entity encoder and decoder
Encode or decode common HTML entities.
Your result will appear here.
Enter your input, then run the tool.How to use the html entity encoder and decoder
Turn characters such as < and & into HTML entities, or turn supported entities back into characters.
Paste text, choose encode or decode, and copy or download the result.
- Paste text or HTML into Input.
- Set Mode to encode (the default) or decode.
- Press Run tool.
- Use Copy result, or download the output as hth-html-entities.txt.
Good to know
- Encoding covers &, <, >, double quotes and apostrophes.
- Decoding covers amp, lt, gt, quot, apos and valid decimal or hexadecimal numeric entities.
- Unknown entities and invalid Unicode numbers are left as written.
- Input is limited to 500,000 characters and processed in your browser.
Examples
- Encode <a href="x">Tom & Jerry</a> → <a href="x">Tom & Jerry</a>.
- Encode it's → it's.
- Decode © © © → © © ©. Numeric forms work, but copy isn’t one of the five supported names.
If something goes wrong
©, or é stay unchanged after decoding.
Only amp, lt, gt, quot and apos are decoded by name. Use the numeric form instead, such as © or  .
&lt; decodes to < instead of <.
Decoding is a single pass, so double-encoded text needs a second run. Paste the result back in and decode again.
& without a semicolon isn’t decoded.
An entity must end with a semicolon. Add it and run again.
Questions
Will it encode every character?
No. It encodes five characters that have special use in HTML.
Will it run HTML?
No. The result is displayed as text.
What happens to an unknown entity?
It remains unchanged in decode mode.
Are entity names case-sensitive here?
No. < and & decode the same as < and &.
Does encoding change accented letters or emoji?
No. They’re left as they are, which is fine on a UTF-8 page. Only the five special characters are replaced.
Background reading: Base64, URL encoding and HTML entities: which one do you need?
Next steps: Text to HTML · Markdown to HTML · URL encoder and decoder
