Skip to content

HTML Entity Encoder/Decoder

Encode text to HTML entities (named, numeric, or hex) or decode entities back to plain text — runs entirely in the browser.

HTML entity encoder / decoder

Empty
Paste HTML or text to encode entities. Flip to Decode to recover the original.
Input Paste HTML or text
0 chars
Output Encoded (named)
0 chars

        
Output will appear here
Type in the left pane or click Sample to see an example.

What is an HTML entity?

An HTML entity is a short code that stands in for a character the browser would otherwise try to interpret as markup. Writing < directly tells the parser a tag is starting; writing &lt; tells it to render a literal < instead. Entities come in three flavours: named (&lt;), decimal numeric (&#60;) and hexadecimal numeric (&#x3C;). All three decode to the same character.

CharacterNamedDecimalHexNotes
&&amp;&#38;&#x26;Always encode — it starts every entity
<&lt;&#60;&#x3C;Encode in text; tag-opener
>&gt;&#62;&#x3E;Safe in text; encode to be strict
"&quot;&#34;&#x22;Must encode inside double-quoted attributes
'&apos;&#39;&#x27;Must encode inside single-quoted attributes
©&copy;&#169;&#xA9;Legible in source; UTF-8 also fine
&mdash;&#8212;&#x2014;Em dash — typography
 &nbsp;&#160;&#xA0;Non-breaking space

In modern UTF-8 documents you only strictly need to encode the five structural characters (& < > " '). Encoding the rest is a matter of taste or a constraint from a consumer that can't safely handle non-ASCII bytes. When in doubt, switch to Non-ASCII only above — it keeps your HTML shape intact and only touches characters that genuinely need escaping.