HTML entities encode and decode
Escape text for HTML, or turn entities back into characters.
Editor
HTML entities encode and decode: what it does
Show code or user text safely on a web page by escaping the characters HTML treats as markup. Or go the other way and turn named and numeric entities such as <, © and é back into readable characters.
HTML entities encode and decode: how to use it
- Paste your text or HTML.
- Choose HTML encode or HTML decode.
- Select Apply and copy the result.
HTML entities encode and decode: when to use it
- Show a code sample or a comparison sign on a web page without the browser reading it as markup.
- Turn the entities of an HTML export back into readable characters for a document.
- Prepare user text for a template where quotes and ampersands must be escaped.
HTML entities encode and decode: examples
Input
<a href="x">Tom & Jerry</a>
Result
<a href="x">Tom & Jerry</a>
Input
<a href="x">Tom & Jerry</a>
Result
<a href="x">Tom & Jerry</a>
Input
Use "width" > 5 & height
Result
Use "width" > 5 & height
HTML entities encode and decode: questions and answers
Which characters does encoding escape?
The five that matter in HTML: ampersand, less-than, greater-than, double quote and single quote.
Does decoding know every entity?
It decodes all numeric entities and the common named ones. An unknown name such as &unknown; is left unchanged.
Are accented letters encoded as entities?
No. Only the five special characters are escaped; letters such as é stay as they are, which is correct for UTF-8 pages.
Does decoding turn into a normal space?
It becomes a non-breaking space character. Run Remove extra spaces afterwards if you want ordinary spaces.
Is my text sent to a server?
No. Everything runs in your browser on your own device, so your text never leaves it.
Related tools
Tools people often use together with this one.
- URL encode and decode
Percent-encode text for a URL, or decode it back.
- Base64 encode and decode
Convert text to Base64, or decode Base64 back to text.
- Remove HTML tags
Strip HTML tags and keep only the text.
- Unicode escape and unescape
Turn non-ASCII characters into \u escapes, or back.
- Text to binary converter
Convert text to binary code, or binary back to text.
- Text to hex converter
Convert text to hexadecimal bytes, or hex back to text.