HTML Entity Encoder / Decoder

About the HTML Entity Encoder / Decoder

HTML entities let you safely display reserved characters — like <, >, &, and quotation marks — inside HTML without the browser interpreting them as markup. Instead of a literal <, you write &lt;, and the browser renders it as the character itself rather than the start of a tag.

This tool converts plain text into its entity-escaped equivalent, and converts entity-encoded HTML back into readable text.

How it works

Common use cases

Frequently asked questions

Does entity-encoding text make it safe from XSS?

Encoding the five characters this tool handles (&, <, >, ", ') covers the most common HTML-injection vector, but real XSS prevention depends on context — attribute values, JavaScript contexts, and URLs each need their own escaping rules. Use a framework's built-in escaping or a dedicated sanitization library for production security, not manual encoding alone.

What's the difference between &lt; and &#60;?

They represent the same character (<) — &lt; is a named entity, while &#60; is the equivalent numeric character reference. Browsers treat them identically.

Why didn't my decode fully restore special symbols like em dashes or emoji?

This decoder relies on the browser's own HTML parser, so it correctly handles the full HTML5 entity set, including numeric references — if something looks off, check that the entity name or number was copied completely, without truncation.

Should I encode plain text that has no HTML in it?

Only the five characters with special meaning in HTML get changed (&, <, >, ", '); ordinary letters, numbers, and punctuation pass through unchanged.

This tool runs entirely in your browser — nothing you enter is sent to a server. Read more in the Privacy Policy, or browse the full list of tools.