Free HTML Entity Encoder & Decoder
Encode or decode HTML entities — plus JSON and JavaScript string escaping — with named, decimal, and hex forms handled.
How to use / FAQ
When do I need to encode HTML entities?
Whenever user text or code samples land inside HTML: the five characters & < > " ' can otherwise be interpreted as markup. Displaying a code snippet on a page, putting text in an attribute, or embedding an example tag all need encoding — it's also the standard defense against injected markup.
What does the non-ASCII option do?
It converts every character outside the basic ASCII range into a numeric reference, like é into é. Modern UTF-8 pages don't need it, but it keeps text intact in emails, legacy systems, or any document whose encoding you don't control.
Why did an entity in my text not decode?
Either it isn't a real entity (the decoder leaves unknown names like ¬arealentity; untouched rather than guessing) or it's malformed — missing the semicolon, or a numeric reference outside the valid Unicode range. Everything recognizable decodes, including hex forms like é.
What's the difference between the JSON and JavaScript modes?
JSON escaping covers quotes, backslashes, and control characters — and it decodes too. JavaScript mode adds the escapes JSON doesn't require but JS string literals do: single quotes, backticks, and the invisible U+2028/U+2029 line separators, which are legal in JSON but break older JavaScript parsers.
Is my text uploaded anywhere?
No. Encoding and decoding run entirely in your browser — nothing you type or paste leaves your device.