Skip to content
KJPOkjpo

HTML Entity Encoder / Decoder

Escape text as HTML entities such as & and <, or decode named and numeric entities such as © and © back to characters.

HTML Entity Encoder / Decoder

Escape text as HTML entities such as & and <, or decode named and numeric entities back to characters.

Your text is processed in your browser and is not uploaded.

How it works

  • Choose Encode or Decode, then type or paste your text. The result updates as you type.
  • When encoding, optionally also encode every non-ASCII character as a numeric entity.
  • Swap moves the result into the input and flips the mode.

Counting rules

  • Encoding always escapes & < > " and ', written as &amp; &lt; &gt; &quot; and &#39;.
  • “Also encode non-ASCII characters” writes each character above U+007E as a decimal entity, so an emoji is one entity.
  • Decoding handles numeric entities (&#169; and &#xA9;) and the 252 HTML 4 named entities plus &apos;. Newer HTML5-only names are left unchanged.
  • Only complete entities ending in a semicolon are decoded; unknown names and invalid numbers are left as typed.
  • Decoding is a single pass: “&amp;lt;” becomes “&lt;”, not “<”.
  • Your text is processed in your browser and is not uploaded.

Worked example: “<a href="x">Tom & Jerry</a>” encodes to “&lt;a href=&quot;x&quot;&gt;Tom &amp; Jerry&lt;/a&gt;”, and decoding that gives “<a href="x">Tom & Jerry</a>” back.

More text tools