HTML Entity Encoder / Decoder

Escape special characters into HTML entities, or decode entities back into plain text, live as you type.

Encode all non-ASCII characters
Also escapes accented letters and emoji, not just < > & " '.

Why HTML entities exist

Some characters are reserved by HTML itself.

Characters like <, >, and & have special meaning in HTML markup, typing them literally inside page content can break the page or, worse, let user input be interpreted as executable markup. Encoding them as entities like &lt; displays the character safely as plain text.

Named vs numeric entities

&amp; and &#38; both decode to the same ampersand, named entities exist for common characters, numeric entities (decimal or hex) can represent any Unicode character at all. This tool decodes both forms.

Common questions

Which characters get encoded by default?

The five HTML-significant characters: < > & " and '. Turn on "Encode all non-ASCII characters" to also escape accented letters, emoji, and other Unicode characters as numeric entities, useful for older systems that only handle plain ASCII safely.

Does this decode numeric entities like &?

Yes, both decimal (&) and hexadecimal (&) numeric entities decode correctly, alongside all the common named entities like &amp; and &copy;.

Is this safe to use on untrusted HTML?

This tool only converts text back and forth, it never renders the HTML as a live page, so pasting untrusted content here is safe. The encoded output is meant to be inserted into your own page's source where it will display as literal text rather than run as markup.