HTML Entity Encoder & Decoder

Escape and unescape HTML entities — safely, in your browser.

Ad placeholder (leaderboard)
Enjoying the tools? Go Pro for £4.99 (one-time) and remove all ads — forever, on this device. Remove ads — £4.99

HTML entity encoder & decoder

Escape text for safe placement inside HTML — &, <, >, " and the apostrophe become their entity equivalents — or decode named and numeric entities back into plain text. Escaping is the core defence against breaking your page layout or introducing cross-site scripting when you display user-supplied text.

How it works

In encode mode the tool replaces each HTML-significant character with its entity: &&amp;, <&lt;, >&gt;, "&quot;, and the apostrophe → &#39;. An optional setting additionally converts every non-ASCII character (accents, symbols, emoji) into a numeric &#...; entity for maximum compatibility. In decode mode it reverses the process, resolving named entities and both decimal (&#NN;) and hexadecimal (&#xNN;) numeric forms — done through a parser that never injects your input into the live DOM, so untrusted markup cannot execute.

Example

Encoding <a href="x">Tom & Jerry</a> gives:

&lt;a href=&quot;x&quot;&gt;Tom &amp; Jerry&lt;/a&gt;

Decoding &copy; 2026 &mdash; caf&#233; gives © 2026 — café.

CharacterNamedNumeric
&&&
<<<
>>>
"""

Everything runs in your browser — nothing is uploaded. Pair it with the URL encoder for query strings.

Ad placeholder (rectangle)