FreeDev Tools

HTML Entity Encoder / Decoder

Encode special characters as HTML entities or decode entity strings back to plain text.

All encoding/decoding runs in your browser — no data is sent to any server.

HTML Entity Encoder converts unsafe HTML characters like <, >, &, and quotes into their safe entity equivalents. The decoder does the reverse, restoring entity sequences back to readable characters.

Frequently Asked Questions

Which characters are encoded? +

The encoder replaces &, <, >, double quotes, and single quotes with their named HTML entity equivalents (&amp;, &lt;, &gt;, &quot;, &#39;).

How does decoding work? +

Decoding leverages the browser's own HTML parser via a temporary textarea element, which means every named and numeric entity is decoded correctly by the engine that renders your web pages.

When should I encode HTML entities? +

Encoding is essential when embedding user-supplied content in HTML to prevent XSS attacks, or when displaying code samples inside HTML documents where angle brackets would otherwise be interpreted as tags.

Frequently Asked Questions

Special codes that represent characters in HTML. &amp; = &, &lt; = <, &gt; = >, &nbsp; = non-breaking space, &copy; = ©.