Skip to content
Web4tools

HTML Entity Encoder & Decoder

Escape text for safe use in HTML, or decode entities back to text.

Runs in your browserNo accountNo watermark

In short

To encode HTML entities, paste your text with Encode selected: <, >, &, " and ' become &lt;, &gt;, &amp;, &quot; and &#39;, so the text displays literally instead of being interpreted as HTML. Choose Decode to turn entities like &copy; back into characters.

How to use the HTML Entity Encoder & Decoder

  1. 1Paste or type your input in the left box (or click "Try an example").
  2. 2Adjust the options if needed. The result updates as you type.
  3. 3Copy the result or download it as a file.

Why escaping matters

Escaping user-supplied text before inserting it into HTML prevents broken layouts and cross-site scripting (XSS). Frameworks like React do this automatically; templates and CMS snippets often don't.

Frequently asked questions

When should I encode all non-ASCII characters?

Only for systems that can't handle UTF-8, such as some legacy email tools. Modern pages should use UTF-8 and leave characters like é as they are.

Does decoding support named entities?

Yes, all HTML5 named entities such as &nbsp; and &euro;.

Is my data sent anywhere?

No. Everything runs in your browser. What you paste is never uploaded, logged or stored, so it's safe for code, tokens and private content.

Last updated