HTML Entity Encoder / Decoder

Encode and decode HTML entities for safe markup display.

Escape HTML entities

Unescape HTML entities

Runs locally in your browser. Your input is not uploaded or stored. You can verify this in your browser’s network panel.

What does this tool solve?

HTML entities escape characters that would otherwise be parsed as markup: < becomes &lt;, & becomes &amp;. Encode text before showing it inside HTML, or decode entities back to readable text.

What examples should you start with?

Encode markup

Input

<p class="x">A & B</p>

Output

&lt;p class=&quot;x&quot;&gt;A &amp; B&lt;/p&gt;

Decode entities

Input

&lt;b&gt;&copy;&lt;/b&gt;

Output

<b>©</b>

Numeric entities

Input

&#65; &#x42;

Output

A B

How does it work?

Encoding replaces the five markup-significant characters (& < > " ') with named entities.

Decoding supports named entities, decimal (&#65;), and hexadecimal (&#x41;) numeric forms. Unknown entities are left untouched rather than mangled.

What are the edge cases and limits?

  • Entity encoding is display-escaping, not sanitization — it does not make untrusted HTML safe to inject as markup.
  • Decoding twice is sometimes needed for double-encoded content (&amp;lt; → &lt; → <).
  • Named entities are case-sensitive: &nbsp; works, &NBSP; is not a standard entity.

Technical reference

Related tools