Skip to content
HandfulTools

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

Loading…

How to use

  1. Choose Encode or Decode.
  2. Paste your text or HTML.
  3. Copy the result.

How it works

Encoding replaces the five characters that have special meaning in HTML — & < > " ' — with &amp; &lt; &gt; &quot; and &#39;. Optionally every non-ASCII character becomes a numeric entity, useful for systems that can't store UTF-8.

Decoding understands numeric entities (&#233;, &#xE9;) and the most common named entities.

Examples

Code in a blog post
<div class="a"> → &lt;div class=&quot;a&quot;&gt;

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: