Developer tools

HTML entity encoder / decoder

Turn special characters into HTML references, or inspect references as readable text without rendering markup.

Processed in your browser
Options
Up to 200,000 input characters

Ready when you are.

A practical example

Input or settings

<p title="Café">Tom & Ana</p>

Example result

&lt;p title=&quot;Café&quot;&gt;Tom &amp; Ana&lt;/p&gt;

When this helps

Useful for showing HTML snippets as text and inspecting encoded content. Results always appear as plain text, so decoded tags are not executed.

How it works and its limits

Encoding replaces &, <, >, double quotes and apostrophes. The optional non-ASCII setting also writes characters outside ASCII as decimal numeric references, using a whole Unicode code point for emoji.

Decoding supports 2,125 HTML5 named references plus decimal and hexadecimal numeric references. A terminating semicolon is required. Named references are case-sensitive; unknown references remain unchanged. Only one decoding pass is made.

Invalid numeric code points become the replacement character. Legacy C1 numeric references follow HTML mappings. This is not an HTML sanitizer, parser or universal escaping solution for JavaScript, CSS, URLs or every attribute context.

Useful details

Will decoded script tags run?

No. The result is displayed in a read-only text field, not inserted as HTML.

Why is &amp;lt; only decoded to &lt;?

Decoding is intentionally one pass, so nested encoding is not recursively expanded.

Are references without a semicolon decoded?

No. This tool requires the semicolon for predictable text conversion.

More developer tools