HTML Entity Encoder / Decoder
Encode special characters to HTML entities or decode entities back to text.
HTML Entity Reference
About HTML Entity Encoding
HTML entities are special codes used to represent reserved characters (<, >, &, ") and symbols (©, €, →) in HTML documents. Without encoding, these characters would be interpreted as HTML markup.
Three encoding formats are available: Named entities (&) are human-readable, numeric (&) use decimal code points, and hex (&) use hexadecimal — all produce the same result in browsers.
This tool runs 100% in your browser. Your text is never sent to any server.
Frequently Asked Questions
What are HTML entities?▼
HTML entities are special codes that represent characters in HTML. Characters like <, >, &, and " have special meaning in HTML, so they must be 'escaped' using entities (e.g., < for <, & for &). Entities are also used for symbols like © (©), € (€), and arrows (→ = →).
What's the difference between named, numeric, and hex entities?▼
All three represent the same characters but in different formats. Named entities (&) are human-readable. Numeric entities (&) use decimal Unicode code points. Hex entities (&) use hexadecimal. Named entities are most common, but numeric/hex support a wider range of characters.
When should I encode HTML entities?▼
You should encode HTML entities when: (1) displaying user-generated content to prevent XSS attacks, (2) including special characters in HTML attributes, (3) showing code examples in web pages, (4) ensuring characters render correctly across all browsers and email clients.
Does this tool encode all characters?▼
This tool encodes HTML-reserved characters (<, >, &, ", ') and non-ASCII characters (like ©, €, accented letters). Standard ASCII letters, numbers, and basic punctuation are left as-is since they don't need encoding.
Is my text stored or tracked?▼
No. All encoding and decoding happens entirely in your browser using JavaScript. Your text is never sent to any server, never stored, and never tracked. You can verify this in your browser's Network tab — no requests are made.
Can I use this for email HTML?▼
Yes! HTML entity encoding is especially useful for email HTML where character encoding support varies across email clients. Encoding special characters and symbols as HTML entities ensures they display correctly in Gmail, Outlook, Apple Mail, and other clients.