HTML Entity Encoder
Encode and decode HTML entities. Convert special characters to named, decimal, or hex references and back.
& & (ampersand)< < (less than)> > (greater than)" " (quote)' ' (apostrophe)© © (copyright) (space)™ ™ (trademark)About this tool
HTML entities are named or numeric codes that represent characters which would otherwise be parsed as HTML markup: the angle brackets < and >, the ampersand &, and non-ASCII characters like © or —. Encoding them prevents browsers from interpreting user-supplied text as live HTML.
Example: pasting <a href="x">Tom & Jerry</a> and choosing Decode yields the rendered text <a href="x">Tom & Jerry</a>. Going the other way, 5 < 7 encodes to 5 < 7 for safe display inside a code block.
Useful when sanitising pasted text for email templates, templating engines, or anywhere a literal < must survive a round trip through HTML.
FAQ
What is the difference between < and numeric 60? ›
Both represent the same character (<). The named form is <; the decimal numeric reference is < and the hexadecimal one is <. Named entities are easier to read; numeric references work for any Unicode code point that has no name.
Does this escape single and double quotes? ›
It encodes " and ' alongside <, >, and &. That covers the five characters the HTML5 spec marks as unsafe in text content and attributes.
Can it decode entities from older HTML pages? ›
Yes. The decoder recognises the common HTML4 named entities ( , ©, — and others) plus all numeric references, and leaves unknown entities untouched.
How is this different from the String Escape tool's HTML mode? ›
The <a href="/string-escape">String Escape / Unescape</a> tool offers a quick HTML escape for the five primary special characters across multiple formats (HTML, URL, JSON, Regex, C-string, Base64) in one place. This tool is dedicated to HTML entities — it encodes and decodes the full set of named entities, decimal references, and hex references, with per-character control over the output format.