HTML Entity Encoder / Decoder
Escape HTML characters or decode named and numeric entities
Encode reserved HTML characters so they display as text instead of markup.
Free HTML Entity Encoder and Decoder
This browser-based tool converts reserved HTML characters such as ampersands, angle brackets, and quotes into entities, or turns named and numeric entities back into readable text. Choose named, decimal, or hexadecimal output and decide whether to escape only HTML special characters or all non-ASCII characters. Everything runs locally in your browser.
How to Encode or Decode HTML Entities
- Choose Encode or Decode.
- For encoding, select an entity style and whether to include non-ASCII characters.
- Paste text or HTML into the input box. The result updates as you type.
- Use Swap to reverse the workflow or Copy to put the result on your clipboard.
Security note: HTML entity encoding helps display text safely in a specific HTML context, but this converter is not an HTML sanitizer and does not replace context-aware output escaping or a trusted security library.
Frequently Asked Questions
What is an HTML entity?
&, <, <, or <. Browsers render the reference as its corresponding character.Which encoding style should I use?
Does decoding execute the HTML?
Is entity encoding the same as sanitizing HTML?
Five Core HTML Entities That Prevent Broken Markup & XSS
Whenever rendering untrusted user text inside HTML elements or attributes, escaping just five characters—& (&), < (<), > (>), " ("), and ' (')—blocks tag injection cleanly while preserving exact visual copy inside code snippets and tutorials.
Frequently Asked Questions
- Why must & be escaped before < and >?
- Escaping & first prevents double-escaping the ampersands inside < and >.
- When should I decode HTML entities?
- When inspecting scraped text, RSS XML descriptions, or CMS exports containing readable copy cluttered with ’ or .
- Does encoding run offline?
- Yes. Everything runs purely in browser JavaScript.