HTML Entity Encoder

Encode special characters to HTML entities (named, decimal, or hex) and decode them back.

By Marshkalk

Encoding mode

How to use the HTML Entity Encoder

  1. Choose an encoding mode: Named for readable names (<), Decimal for numeric codes (<), Hex for hexadecimal codes (<).
  2. Paste text into the left box and click Encode.
  3. To decode HTML entities back to plain text, paste entities on the left and click Decode.

Common HTML entities

CharacterNamedDecimalHex
&&&&
<&lt;&#60;&#x3C;
>&gt;&#62;&#x3E;
"&quot;&#34;&#x22;
'&apos;&#39;&#x27;
©&copy;&#169;&#xA9;
®&reg;&#174;&#xAE;
&euro;&#8364;&#x20AC;
£&pound;&#163;&#xA3;
&rarr;&#8594;&#x2192;

Why encode HTML entities?

HTML entities are required when you need to display characters that have special meaning in HTML. For example, < and > delimit HTML tags, to display them as literal characters you must write &lt; and &gt;.

Common situations requiring encoding:

  • Displaying user-generated content (preventing XSS injection)
  • Embedding code samples in HTML documents
  • Including special typographic characters (em dashes, curly quotes, arrows)
  • Ensuring correct rendering of non-ASCII characters in older HTML (before UTF-8 became universal)