HTML Entity Encoder & Decoder

Convert special characters to HTML entities (named or numeric) or decode entities back to their original characters. Essential for preventing XSS and displaying HTML safely.

Conversion mode

Common HTML Entities Reference

Character Named Entity Numeric Entity Description
&&&Ampersand
<&lt;&#60;Less than
>&gt;&#62;Greater than
"&quot;&#34;Double quote
'&apos;&#39;Single quote
 &nbsp;&#160;Non-breaking space
©&copy;&#169;Copyright
&euro;&#8364;Euro sign

What are HTML entities?

HTML entities are special codes used to represent characters that have meaning in HTML syntax or cannot be typed directly. For example, the less-than sign (<) must be written as &lt; in HTML to prevent the browser from interpreting it as the start of a tag.

There are two formats: named entities (like &amp; for &) which are human-readable, and numeric entities (like &#38;) which use the character's Unicode code point. Both produce the same result in the browser.

FAQs

Why should I encode HTML entities?

Encoding prevents browsers from interpreting special characters as HTML markup. This is critical for preventing Cross-Site Scripting (XSS) attacks and for displaying code snippets correctly on web pages.

What is the difference between named and numeric entities?

Named entities use memorable names like &amp; or &lt;. Numeric entities use the character's Unicode number like &#38;. Named entities are easier to read but not all characters have named versions — numeric entities work for any character.

Is this tool processed server-side?

No. All encoding and decoding happens entirely in your browser using JavaScript. Your text never leaves your device.

Can I encode entire HTML documents?

Yes. Paste any text including full HTML documents. In encode mode, all special characters will be converted to safe HTML entities. This is useful for displaying source code on web pages.

Related Tools