Free sitesAI PulseDaily BriefDailyCalcDevPocketEcoStepsNeed a website? Get one made →

HTML Entity Encoder & Decoder

Encode the characters that break HTML (&, <, >, quotes) or decode named and numeric entities such as © and € back into plain text.

Why escape HTML

Browsers read < as the start of a tag and & as the start of an entity. Showing user text without escaping those characters breaks layouts and opens the door to cross-site scripting (XSS). Escaping the five special characters makes any text safe to place between tags or inside a quoted attribute.

Handy entities

EntityCharacter
&amp;&
&lt; &gt;< >
&quot;"
&nbsp;non-breaking space
&copy;©
&mdash;—

Notes

Decoding understands numeric entities (decimal and hex) and the most common named ones. Unknown names are left as they are.

Frequently asked questions

Do I need to encode accented letters?

Not on a UTF-8 page - tick the option only for old systems that need pure ASCII.

Is escaping enough to stop XSS?

It covers text between tags and quoted attributes; URLs, scripts and styles need their own rules.

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

Both are an apostrophe; &#39; works in older HTML too.

More tools