HTML Entity Encoder & Decoder

Escape the characters that break HTML, or turn entities such as © and € back into readable text. Works entirely in your browser.

Runs in your browser — nothing is uploaded

Escaped

About the HTML Entity Encoder & Decoder

Five characters carry special meaning in HTML: ampersand, less-than, greater-than, double quote and single quote. Writing them as entities such as & or < stops the browser from reading user text as markup, which is the basic defence against cross-site scripting when you place content into a page.

Named entities such as © and € cover common symbols, and numeric references such as € or € can represent any Unicode code point. Decoding turns them back into the characters they stand for, so a value copied from source code or a feed becomes readable again.

Escaping is not a substitute for a template engine or a sanitiser. Use this tool to inspect and prepare text; frameworks should escape output automatically when they render pages.

FAQ

HTML Entity Encoder & Decoder — frequently asked

Which characters must be escaped in HTML?

At minimum the ampersand, less-than, greater-than, double quote and single quote. The ampersand must be handled first: if < were replaced with &lt; before ampersands were escaped, the new ampersand would be escaped again. This tool escapes ampersands first, so the output decodes correctly.

What is the difference between &#39; and &apos;?

&#39; is the numeric reference for the apostrophe and works in every HTML version. &apos; is a named entity defined in HTML5 and XML, but some older browsers and email clients do not recognise it. This tool uses &#39; for maximum compatibility.

Why does &nbsp; look like a normal space but behave differently?

&nbsp; stands for a no-break space, U+00A0. It looks like a normal space but is a different character, so search, comparison and identifier code may treat it differently. Replace it with a regular space when the text is used as data rather than display.

Are hexadecimal references case-sensitive?

The x in a hexadecimal reference is case-insensitive, so &#x20AC; and &#X20ac; name the same character. Named entities are case-sensitive in the HTML standard. This tool knows only a common subset, and any name it does not list is left unchanged.

Does unescaping change text that is not an entity?

No. Only sequences that start with an ampersand, contain a name or number, and end with a semicolon are replaced. An ampersand followed by a space or an unknown name stays exactly as typed.

Is my text uploaded?

No. Escaping and unescaping run with JavaScript in your browser, so markup pasted here stays on your machine.

    Report an issue