HTML Encoder Decoder — escape & unescape HTML entities
Convert text to HTML entities and back, live as you type. Encode &, <, > and quotes as named, decimal or hex entities — optionally including accented and non-ASCII characters — or decode any entity soup back into readable text, with a rendered preview.
Entity style (encoding)
Characters to encode
Essential covers the five characters that matter in HTML: & < > " and '. “+ Non-ASCII” also encodes accented letters, symbols and emoji. “Everything” encodes every character — useful for obfuscating an email address from scrapers.
Rendered preview of the decoded text
Start from an example
One click loads the text and the settings that suit it — the conversion runs immediately.
Your session
Conversions from this visit, kept only in this tab's memory — step back and forth, pin the ones you want to keep handy, and restore any of them with one click. Nothing here is stored or sent anywhere.
Recent conversions
No conversions yet this session — type or load an example and they will appear here.
Pinned conversions
No pinned conversions yet — pin one above to keep its result handy.
Your tools
Tools you have actually opened this session, plus any you pin as favorites. The lists live in this browser session only.
Recently used
No other tools opened yet this session — tools you visit will appear here.
Favorite tools
No favorites yet — pin a tool below.
All encoding & conversion tools
How to use the HTML encoder / decoder
- Choose Encode to turn text into entities, or Decode to turn entities back into text.
- Paste or type your text — the conversion happens live, with counts of exactly how many entities were written or resolved.
- For encoding, pick an entity style (named, decimal or hex) and a scope, then copy or download the result.
Worked example
When do you need HTML encoding?
Any time text must be displayed rather than interpreted: showing a code snippet on a web page, embedding user comments, reviews or names into a template, putting a value inside an attribute, or printing an email address in a way simple scrapers skip. Encoding the five essential characters — & < > " ' — covers HTML text and quoted attribute values. Encoding non-ASCII characters as well makes output safe for legacy pages that are not served as UTF-8.
Common HTML entities reference
| Character | Named | Decimal | Hex | Description |
|---|---|---|---|---|
| & | & | & | & | Ampersand |
| < | < | < | < | Less-than |
| > | > | > | > | Greater-than |
| " | " | " | " | Double quote |
| ' | ' | ' | ' | Apostrophe (no HTML4 named form) |
| (space) | |   |   | Non-breaking space |
| © | © | © | © | Copyright sign |
| ® | ® | ® | ® | Registered sign |
| ™ | ™ | ™ | ™ | Trade mark sign |
| € | € | € | € | Euro sign |
| £ | £ | £ | £ | Pound sign |
| — | — | — | — | Em dash |
| – | – | – | – | En dash |
| … | … | … | … | Ellipsis |
| × | × | × | × | Multiplication sign |
| ÷ | ÷ | ÷ | ÷ | Division sign |
The decoder understands all three forms plus every named entity defined in HTML5 — paste a full entity table or a scraped snippet and it resolves them all, then shows the rendered preview so you can see exactly what a browser would display.
Where encoded text usually goes next
Encoded output rarely stays on this page. If the result is headed for a link or query string, run it through the URL Encoder/Decoder next; to embed it in a data payload, shape it in the JSON Formatter or the XML Formatter; to transport it as opaque text, use the Base64 Encoder/Decoder. The “Send output to…” bar above carries the current result into each of those tools for you — and text those tools send back arrives here ready to encode or decode.
Frequently asked questions
What is HTML encoding?
HTML encoding (escaping) replaces characters that have a special meaning in HTML — &, <, >, double quotes and single quotes — with entity references such as &, < and >. The browser then displays the character as text instead of treating it as markup, which lets you show code samples on a page and safely insert untrusted text.
Which characters must be encoded in HTML?
At minimum, & must become & and < must become < in text content. Inside attribute values, the quote character that wraps the value must also be encoded (" as " in double-quoted attributes). Encoding > and ' as well is harmless and is what this tool does by default.
What is the difference between named, decimal and hex entities?
They are three spellings of the same character. © can be written as the named entity ©, the decimal entity © or the hexadecimal entity ©. Named entities are the most readable but only exist for a subset of characters; decimal and hex references work for any Unicode code point. All three are decoded identically by browsers.
Why is the apostrophe shown as ' instead of a named entity?
HTML4 did not define a named entity for the apostrophe (' was added in XHTML and HTML5), so ' is the form that works in every HTML parser, old and new. This tool uses ' in named mode for maximum compatibility.
Does HTML encoding prevent XSS?
Encoding is the correct defence when inserting untrusted text into HTML content or attribute values, because the browser treats the encoded characters as text, not markup. It is not sufficient on its own in every context — URLs, JavaScript strings and CSS need their own context-specific escaping — so treat it as one essential layer, not a complete security solution.
What happens if I encode text that already contains entities?
The & of each existing entity is itself encoded, so < becomes &lt;. That is correct behaviour for displaying the literal text “<” on a page, but if your text is already encoded, decode it first instead of encoding it a second time.
Is my text uploaded or saved?
No. Encoding and decoding happen entirely in your browser as you type; nothing is uploaded, stored or tracked.
How do I hide an email address from scrapers with HTML encoding?
Encode the address with the scope set to Everything: every character becomes a decimal entity, so the page source contains no plain-text address for simple harvesters to grab, while browsers and mail clients render and link it normally. It is obfuscation, not encryption — a determined scraper can decode entities — so treat it as a spam-reduction layer, not a security control.
Can I decode a whole snippet of entity-encoded HTML at once?
Yes. Paste the entire snippet in Decode mode and every named, decimal and hex entity in it resolves in a single pass. The rendered preview then shows the result exactly as a browser would display it, with scripts and event handlers stripped for safety.
Related encoding & conversion tools
About this tool
The HTML Encoder Decoder is one of 33 free utilities in the Online Utilities Suite at dev.conversiontools.online. Every tool runs entirely in your browser — your text is never uploaded, stored or tracked — so conversions are instant and private. Decoding uses the browser's own HTML parser, so named entities resolve exactly as a real page would render them.
Privacy
This page processes everything locally in your browser: no account, no uploads, and nothing you type is stored or sent to a server. The rendered preview strips script elements and event-handler attributes before displaying decoded markup. Advertising on this site is served by Google AdSense, which may use cookies to personalize ads; you can opt out of personalized advertising in your Google ad settings.