HTML Entity Encoder & Decoder
Escape special characters like &, <, and > into HTML entities, or decode entities back to plain text.
Last updated
How to encode HTML entities
- Paste the text or HTML.
- Click Encode to escape special characters, or Decode to turn entities back into characters.
- Click Copy result.
Why entity-encode text
Characters like <, >, &, and quotes have special meaning in HTML, so inserting raw user text into a page can break markup or open the door to injection. Encoding replaces them with named entities — &, <, >, ", ' — so they render as literal text instead of being parsed as markup.
Conversion happens locally in your browser tab; nothing is uploaded.
Questions about HTML entities
What are HTML entities?
Codes that stand for characters with special meaning in HTML: < for <, > for >, & for & and " for a double quote.
Why encode text before putting it in a web page?
So it shows as text instead of being read as code. It stops user input from breaking the page or injecting scripts.
How do I show HTML code on a web page?
Encode it and paste the result inside a <pre> or <code> element; the browser then displays the tags instead of running them.
How do I decode & and '?
Paste the text and click Decode: & becomes & and ' becomes an apostrophe.