🏷️ HTML Entity Encoder / Decoder
Encode HTML special characters to safe entities or decode entities back to readable text — all in real time, entirely in your browser with no data sent anywhere.
About
This tool handles HTML entity encoding and decoding directly in your browser using JavaScript — no server, no upload, no account. It converts the five essential HTML characters (& < > " ') to their named entities (& < > " ') to prevent XSS and markup breakage. An optional mode also encodes all non-ASCII characters as numeric entities (&#NNN;), which is useful for environments that require pure ASCII output. Decoding reverses the process, turning both named entities like © and numeric forms like © back into their original characters. Results update in real time as you type.
How to use
- Paste or type your text into the input box on the left.
- Choose a mode: Encode (text → entities) or Decode (entities → text).
- When encoding, optionally enable 'Encode all non-ASCII' to convert characters like é, ©, or emoji to numeric entities.
- The output updates in real time — copy it with the Copy button.
FAQ
- What is an HTML entity?
- An HTML entity is a text sequence that represents a character which would otherwise be interpreted as HTML markup. For example, < represents < so the browser displays a less-than sign instead of treating it as a tag.
- Which characters are encoded by default?
- By default the tool encodes the five characters that break HTML: & becomes &, < becomes <, > becomes >, " becomes ", and ' becomes '. Enable the non-ASCII option to also encode accented letters, symbols, and emoji.
- Can it decode both named and numeric entities?
- Yes. The decoder handles named entities like © and é, decimal numeric entities like ©, and hexadecimal numeric entities like © — all converted back to their Unicode characters.
- Is my text sent to a server?
- No. All encoding and decoding runs locally in your browser using JavaScript. Nothing leaves your device.
- When should I use numeric entity encoding for non-ASCII characters?
- Use it when your output must be pure ASCII — for example, legacy email systems, certain XML parsers, or older CMS platforms that do not reliably handle UTF-8. For modern UTF-8 HTML, encoding only the five special characters is sufficient.