All tools Developer

HTML Entity Encoder

Encode HTML special characters as entities, or decode entities back.

Runs in your browser. Nothing you open or type here is uploaded.

How to use

  1. Paste or type the text into the input field.
  2. Choose Encode to turn special characters into entities, or Decode to turn entities back into characters.
  3. Copy the converted text from the output field.

Details

HTML reserves characters such as <, > and & for markup. Writing them as entities — &lt;, &gt; and &amp; — makes the browser display them as text instead of parsing them as tags. This tool encodes those characters plus double quotes and apostrophes, and writes any non-ASCII character as a numeric entity. Decoding runs the same table in reverse, turning entities back into readable characters. Encoding is the step needed before placing code samples or untrusted text into an HTML document.

  • Decoding is the direction you need when a CMS or a feed hands you text full of entities and you need the readable version back.
  • Non-ASCII characters become numeric entities, which keeps the output valid in documents that are not served as UTF-8.

Common questions

What gets encoded?

&, <, >, double quotes, and apostrophes — plus any non-ASCII character as a numeric entity.

When do I need this?

Displaying code samples inside HTML, or sanitizing user text before rendering it on a page.

Is my text uploaded?

No — it never leaves your browser.