HTML Entity Encoder/Decoder

What are HTML entities?

HTML reserves five characters — &, <, >, " and ' — for markup. To show them as literal text you escape them as entities: &amp;, &lt;, &gt;, &quot; and &#39;. Entities also come in numeric form (&#169; or &#xA9; for ©) and as hundreds of named references like &nbsp;, &copy; and &hellip;.

Not to be confused with URL encoding: entities protect text inside HTML documents, percent-encoding protects text inside URLs. For query strings and links, use the [URL encoder](/url-encode) instead.

Features

  • Encode — Escapes & first (so nothing gets double-encoded), then < > " '. The apostrophe becomes &#39;, which works in every HTML version.
  • Optional non-ASCII encoding — Turn accented characters and emoji into &#x…; numeric references, safe for ancient charsets and email templates. Astral characters are emitted as a single reference.
  • Decode — Handles named entities, decimal and hex numeric references, and applies the same browser rules: lone surrogates and out-of-range code points become U+FFFD, and C1 references like &#128; map through Windows-1252 (→ €).
  • Strict and honest — Decoding runs in a single pass (so &amp;lt; becomes &lt;, not <), entities without a semicolon produce a clear error, and unknown entities are flagged instead of silently passing through.

How to use

1. Pick Encode or Decode

2. Paste your text — in encode mode, tick Also encode non-ASCII if you need ASCII-only output

3. Copy the result with one click

Privacy

All encoding and decoding happens locally in your browser. Nothing you paste is ever sent to a server.

Read the full HTML Entity Encoder/Decoder guide and the HTML Entity Encoder/Decoder API reference.