Formula
& → & < → < > → > " → " ' → '© and © → ©
- Numeric entities use the character's Unicode code point, in decimal (©) or hex (©)
Entities are text codes that stand for characters with special meaning in HTML.
Worked examples
Encode a snippet
- Direction
- Encode (text → entities)
- Text
- <p class="note">Tom & Jerry's © 2026</p>
- When encoding
- Only & < > " '
Encoded text
<p class="note">Tom & Jerry's © 2026</p>
Characters escaped: 8
<p class="note">Tom & Jerry's © 2026</p>
Decode entities
- Direction
- Decode (entities → text)
- Text
- Tom & Jerry's © 2026
Decoded text
Tom & Jerry's © 2026
Entities decoded: 3
Tom & Jerry's © 2026
How it works
Five characters have special meaning in HTML: & starts an entity, < and > delimit tags, and the two quote marks delimit attribute values. To show them as plain text, or to put arbitrary text inside a page, they are replaced with entities: &, <, >, " and '. The encoder also offers to turn every non-ASCII character into a numeric entity such as © for ©, which is useful for systems that only accept ASCII.
The decoder reverses this: it understands numeric entities in decimal and hex, and about sixty of the most common named ones such as , ©, € and …. Anything it does not recognise is left exactly as typed and listed for you, so nothing is silently changed. The result is shown as plain text and is never rendered as HTML.
Escaping is the right way to display untrusted text safely, but it is not a replacement for a sanitiser when you must allow some HTML. For percent-encoding in URLs use URL Encode and Decode, for binary-safe text Base64 Encode and Decode, and to tidy markup use the HTML Formatter.
Assumptions and limits
- Named-entity decoding covers a common subset, not all 2,000+ HTML entities.
- The result is plain text only.