HTML Entity Encoder & Decoder
Type or paste text and get the HTML-entity-encoded version, or paste an entity-laden string and read it back as plain text. Three encoding strategies, one click to copy.
Type or paste text and get the HTML-entity-encoded version, or paste an entity-laden string and read it back as plain text. Three encoding strategies, one click to copy.
Hello <world> & "friends" — it's 100% client-side.
HTML reserves five characters for its own syntax: < > & " '. To use them as literal text, you have to escape them as entities: <, >, &, ", '. Beyond the reserved set, every Unicode codepoint can be expressed numerically as &#NN; (decimal) or &#xNN; (hex), or by a named alias for common ones (©, —, €).
Modern browsers, modern frameworks (React, Vue, Svelte) and modern templating engines auto-escape values when rendering, so you rarely write HTML entities by hand. But you'll still encounter them in legacy XML, RSS feeds, email templates, RSS-to-blog migrations, and copy-paste from a Word doc into a CMS that didn't normalise quotes.
Minimal for text destined for HTML body content (the framework will handle the rest). Named for human-readable export (RSS, email templates) where you want © instead of ©. Numeric when transmitting through systems that may not handle non-ASCII safely (legacy SMTP gateways, ASCII-only logs).
Because we use the browser's HTML parser via a textarea trick. The parser knows the full HTML5 entity table, so things like ✓ or ↾ decode correctly without us shipping the table.
' is a valid HTML5 entity but was not in the original HTML 4 spec. Older browsers (IE6-7) didn't recognise it. Today every browser does, but if you're generating XML or older HTML, prefer ' for the apostrophe to stay maximally compatible.
Emoji are valid Unicode codepoints, so the numeric strategy will encode '🎉' as '🎉'. They render fine in modern browsers either as raw UTF-8 or as the numeric entity. Choose based on whether your downstream system handles UTF-8 reliably.
Yes. Encoding and decoding happen entirely in your browser. Your text never reaches our servers, so the tool is safe even with confidential content.
Where HTML entity work crops up.
Showing '<div>' as literal text in documentation requires escaping. Run your code snippet through the encoder before dropping it into a <pre><code> block.
Some CMSes export content with double-encoded entities ('&amp;'). Decode once to get '&', decode again to get '&'. The tool makes a one-click round-trip painless.
Email clients vary in their UTF-8 handling. Encoding non-ASCII as numeric entities (€ → €) ensures consistent rendering across Outlook, Gmail and corporate webmail.
RSS items often contain HTML-encoded text. Paste a suspicious item's description into the decoder to see what the actual prose looks like.
Habits that prevent encoding bugs.
If you escape a value and your framework escapes it again on render, the output will show literal '&' instead of '&'. Most modern frameworks (React, Vue, Svelte) auto-escape, so just pass plain text.
Inside HTML attributes, you must additionally escape ' and " and the framework you use may not. Use the Minimal encoding for attribute values to be safe.
If your server emits UTF-8 (the modern default), you don't need numeric entities for non-ASCII characters. Reserve numeric encoding for transports that may not be UTF-8 clean.
If you need to allow some HTML from users (a comments box, a markdown renderer), don't roll your own escaping — use DOMPurify or your framework's sanitiser. Naive escaping leaves XSS holes.