UTILS.
Private by default
&

HTML Entity Encoder

Encode text to HTML entities or decode entities back to text.

Your files stay on this device

Files are processed in your browser, never uploaded. The site downloads code and assets to run the tools. No accounts or trackers.

Use Download to save this tool as one HTML file for offline use.

Privacy →
output

About this tool

Encode special and non-ASCII characters as HTML entities so they display literally in a web page, or decode named and numeric entities back into plain text. Useful when showing code or symbols inside HTML.

Encode converts <, >, &, double and single quotes, and every non-ASCII character, emoji included, into decimal references such as &#60;, &#233; and &#128512;. It does not write named entities like &lt;. ASCII letters, digits and spaces stay. Decode uses the browser's HTML parser, so tags in the input stay as text. Both run on button press.

Frequently asked questions

Why escape characters like < and &?
In HTML these have special meaning. Escaping them (this tool writes &#60; and &#38;) makes them render as literal characters instead of markup.
Does it decode named entities?
Yes. Both numeric (&#233;) and named (&eacute;) entities decode back to the original character.
Which characters does Encode convert?
The five characters < > & " and ', plus every character outside ASCII.
Does it escape every non-ASCII character?
Yes. Everything outside plain ASCII is written as a decimal reference, including emoji and accented letters. Plain ASCII letters, digits, spaces and punctuation other than the five above are left as typed.

More tools