HTML Entity Encoder / Decoder
Show code snippets in a web page without the browser interpreting them, or turn entity-filled text such as “Café” back into “Café”.
Runs in your browser
How to use
- Choose Encode or Decode.
- Paste your text or HTML.
- Copy the result.
How it works
Encoding replaces the five characters that have special meaning in HTML — & < > " ' — with & < > " and '. Optionally every non-ASCII character becomes a numeric entity, useful for systems that can't store UTF-8.
Decoding understands numeric entities (é, é) and the most common named entities.
Examples
- Code in a blog post
- <div class="a"> → <div class="a">
Common uses
- Displaying code in HTML pages
- Cleaning entity-encoded text from feeds and databases
- Escaping user-provided text in templates
Privacy & security
This tool runs entirely in your browser. Your files and text are never uploaded to our servers — processing happens on your device and results are created locally. How each tool handles files
Frequently asked questions
Does encoding prevent XSS?
Escaping text placed between HTML tags is one essential part of XSS prevention, but attributes, URLs and scripts need context-specific escaping. Use your framework's built-in escaping.
Are all named entities supported when decoding?
The most common ones are (accents, quotes, dashes, currency symbols). Numeric entities always work.
Last updated: