HTML Entity Encoder & Decoder

Encode special HTML characters to entities to prevent parsing, or decode HTML entities back. Fast, free, and fully client-side. Nothing is uploaded to a server.

Input
0 chars · 0 words
Output
0 chars

How the HTML Entity Encoder & Decoder Works

Replaces HTML-significant characters with entities such as & and <, or converts entities back into their characters. The Special scope encodes only ampersand, angle brackets, double quote, and single quote. The All Non-ASCII scope also converts every character above code point 127 into a numeric reference. The conversion runs in your browser and nothing is uploaded.

Usage Example

Escape a snippet of user-supplied text containing angle brackets before inserting it into a web page template as plain content.

Frequently Asked Questions

What is the difference between the two scopes?

Special scope escapes only the five characters that can change HTML structure. All Non-ASCII scope additionally rewrites accented letters, symbols, and emoji as numeric references, which keeps the output pure ASCII for systems that cannot handle Unicode.

Does decoding handle named and numeric entities?

Yes. Decode mode reads the input as HTML and returns the text content, so named entities like © and numeric references like € both become characters. Any tags in the input are removed, so only the text remains.

Is HTML encoding enough to make user input safe?

Escaping the special characters prevents the text from being read as markup in most text contexts. It does not sanitize attributes, scripts, or URLs, so use a context-aware approach in production code instead of relying on this tool alone.

Browse more

See all encoding and decoding tools.