HTML Entity Encoder & Decoder

Escape &, <, >, quotes and any Unicode character for safe HTML — or decode named, decimal and hex entities back to plain text. Live, both directions.

Live — converts as you type

Off = only the 5 HTML-critical characters (& < > " ') are escaped.

0 characters

Encoded result

0 characters

Converted on your device — your text is never uploaded.

When (and Why) to Escape HTML

Five characters carry structural meaning in HTML: & starts an entity, < and > delimit tags, and " / ' end attribute values. Any of them appearing in user text, code samples or data must be escaped — otherwise the browser interprets instead of displays, breaking layout at best and enabling XSS injection at worst. Decoding runs the other way: turn &amp;eacute;-littered text from feeds, scrapes or logs back into readable characters, including decimal (&#169;) and hex (&#xA9;) forms.

For other escaping jobs, see the URL Encoder/Decoder (percent-encoding for links), Base64 Encoder (binary-safe transport) and the Markdown Previewer (which escapes its HTML output automatically).

The characters that matter most

CharacterNamedDecimalHexMust escape?
&&amp;&#38;&#x26;Always
<&lt;&#60;&#x3C;Always
>&gt;&#62;&#x3E;In content
"&quot;&#34;&#x22;In attributes
'&#39;&#39;&#x27;In attributes
©&copy;&#169;&#xA9;Optional (UTF-8)
€&euro;&#8364;&#x20AC;Optional (UTF-8)
Non-breaking space&nbsp;&#160;&#xA0;Optional

Frequently Asked Questions

What are HTML entities and why do I need them?
Escape sequences that make HTML-special characters display as literal text: < becomes &lt; so the browser doesn't read it as a tag. Escaping untrusted text is also the core defense against XSS.
Which characters must always be escaped?
& < > in content, plus " and ' inside attributes. With UTF-8 pages everything else (accents, emoji) may appear literally — numeric entities just make it encoding-proof.
Named vs numeric entities — which should I use?
Named (&copy;) are readable but exist only for a fixed list; numeric (&#169; / &#xA9;) work for every Unicode character. This tool outputs either style and decodes all three forms.
Does escaping HTML prevent XSS?
It neutralizes injected markup in HTML content and quoted attributes — the most common vector. Scripts, URLs, CSS and event-handler contexts need their own context-specific escaping.
Is my text uploaded anywhere?
No — encoding and decoding run entirely in your browser. Nothing is sent, stored or logged.