HTML Entity Encoder/Decoder
Convert text to and from HTML entities like &, <, and é instantly, right in your browser — nothing ever leaves your device.
🔒 Processed locally in your browser
Loading…
How to use
- Choose Encode or Decode using the mode toggle above.
- In Encode mode, type or paste any text into the input box.
- In Decode mode, paste text containing HTML entities instead.
- The result updates instantly below — use Copy to copy it, or Reset to clear.
Features
- Escapes the 5 XML-safe characters (& < > " ') needed to safely embed text as HTML
- Also encodes common accented letters as named entities, like é → é
- Decodes named entities, decimal entities (é), and hex entities (é)
- Updates live as you type — no button to press
- 100% client-side — your text never leaves your browser
Frequently asked questions
Why do I need to encode characters like < and & for HTML?
Browsers treat < and & as the start of markup. If you insert text containing a raw < into an HTML page without encoding it, the browser may try to interpret it as the start of a tag instead of displaying it literally, which can break the page or, in the worst case, allow HTML injection. Encoding it as < guarantees it always displays as the character < .
Is this tool a general-purpose HTML sanitizer?
No. This tool encodes plain text so it displays safely as HTML text content — it doesn't parse, clean, or validate existing HTML markup. If you need to sanitize untrusted HTML (e.g. removing scripts from user-submitted HTML), you need a dedicated HTML sanitizer library, not this tool.
What's the difference between ' and '?
Both represent an apostrophe ('). ' is the numeric form and is safe in all HTML versions; ' is a named entity that wasn't officially part of HTML until HTML5. This tool encodes apostrophes as ' for maximum compatibility, but decodes both forms.
What's the difference between a named entity and a numeric entity?
A named entity like é uses a memorable name for a specific character. A numeric entity like é or é specifies the character's Unicode code point directly, in decimal or hexadecimal. Numeric entities can represent any character in Unicode; named entities only exist for a defined set of common ones.
Does this tool store or upload my data?
No. All encoding and decoding happens locally in your browser using JavaScript. Nothing is sent to a server or stored anywhere.