HTML Entity Encoder / Decoder

Escape or unescape HTML entities for safe markup and debugging.

The HTML Entity Encoder / Decoder escapes and unescapes the characters that are special in markup, namely ampersand, angle brackets, and quotes. Encoding turns them into named or numeric entities so they display as literal text instead of starting a tag, which is how you safely insert user content into a page. Decoding goes the other way and is useful when you have stored text that is full of entities and you want the plain characters back. The tool is handy when building templates, debugging pages that show raw entities, or checking that a string will not break your markup. Markup uses a handful of characters as syntax, so those characters cannot appear literally where you intend them as text. The ampersand begins an entity reference, the angle brackets delimit a tag, and the quotes delimit an attribute value, which means each of them has to be replaced by a named or numeric reference when it is meant to be displayed rather than interpreted. That replacement is what lets user supplied text appear on a page as text instead of being parsed as markup, and getting it right is the difference between showing a comment and running it. Decoding is the mirror operation and solves a different everyday problem: stored text sometimes arrives full of references, either because a previous encoder escaped it or because a producer double encoded it, and decoding restores the characters so you can see what is really there. Seeing the literal text amp or lt on a rendered page is the signature of this class of bug. Use the tool when you are building templates, checking that a string is safe to interpolate, or untangling a value that has been encoded more than once.

Private by design. Every tool runs 100% in your browser — your code, text, and tokens never leave your device. Nothing is uploaded or stored.
Output

Result appears here.

Frequently Asked Questions

Why encode HTML entities?

Encoding &, <, >, ", ' as entities prevents them from being parsed as markup and keeps documents valid.

When would I decode?

To read stored entity text as plain characters, for display or further processing.

Does it run locally?

Yes — entirely in your browser.

Related tools from our network

A focused set of free calculators and guides across related topics — no account required.