Encoding turns characters into entities. You need it when you show code on a web page (like
the examples below), put user text into HTML, or write characters that might get mangled in an old email or
XML file. Decoding does the opposite: it turns <p> back into
<p>, which is handy when you copy escaped text out of a database, an API response or a page
source. This tool does both, right in your browser.
How to Use It – Step by Step
Five short steps. Paste the examples into the tool above to try them.
Step 1 Pick Encode or Decode
Use the Encode / Decode switch above the result. Then paste your text on the left, open a
file, or click Sample (it loads a sample for whichever direction you picked). The result
updates as you type.
Encode: you have normal text or HTML and want it safe to show inside a web page.
Decode: you have text full of & and ' and want it readable again.
Step 2 Encode the Five Special Characters
By default only &<>" and '
are encoded. That’s all HTML ever requires, and it keeps everything else readable. This is what you need to
show a piece of HTML as text on a page, for example inside a <pre> block.
Try it: a link shown as code
Text:
<a href="/search?q=tea&cups=2">Tea & "Cake"</a>
Encoded:
<a href="/search?q=tea&cups=2">Tea & "Cake"</a>
💡 See the & in the URL? It becomes & too. Technically that’s the
correct way to write it in an href, and the browser turns it back into & when
you click.
Step 3 Encode Accents, Symbols and Emoji Too
Tick Non-ASCII too and every character outside plain English ASCII becomes an entity, so
the text survives even in places that aren’t UTF-8. Choose the Style: named entities are
easier to read, numeric ones work for every character. Named mode uses a number when a character has no
name, like emoji.
Switch to Decode and paste text with entities. Named (é), decimal
(©) and hex (😀) entities all work, because the browser’s own
HTML parser does the decoding. It knows every one of the 2,000+ names, even the odd ones.
Try it: escaped HTML from a database
Encoded:
<p>Fish & Chips – only £5!</p>
Café © 2026 😀
💡 Seeing &lt;? That text was encoded twice. Decode it, then click Swap to decode
the result once more.
Step 5 Swap, Copy or Download
Swap: moves the result to the left and flips the direction, so you can check a round trip.
Copy: puts the result on your clipboard.
Download: saves it as a .txt file.
Next step: paste decoded HTML into the HTML Viewer to see how it renders, or
into the HTML Formatter to tidy it up.
Common HTML Entities
The ones you’ll use most. Named and numeric versions mean exactly the same thing. Need another one? See the
full list of HTML entities (300+ characters, click to copy).
In normal text, & and < always, because they start entities and tags. Inside an attribute value, also the quote you wrapped the value in (" or '). Encoding > as well is common and harmless. Those five, & < > " ', are what this tool encodes by default.
Do I need to encode é, ü, € or emoji?
Not if your page is saved as UTF-8 and has <meta charset="utf-8">, which is true for nearly every modern site. Tick “Non-ASCII too” when the text goes somewhere that might not be UTF-8, like an old email template, an XML feed or a system that mangles special characters. Then every non-ASCII character becomes a plain-ASCII entity.
Named or numeric entities, which is better?
Both work in every browser. Named ones like é and € are easier to read. Numeric ones like é work for every character, including emoji, which have no names. In Named mode this tool uses a name when there is a well-known one and falls back to a number otherwise.
Why is the apostrophe ' and not '?
' is valid in HTML5 but wasn’t part of HTML 4, and some older email apps still don’t understand it. ' works everywhere, so it’s the safer choice.
How does decoding work? Is it safe?
Decoding uses the browser’s own HTML parser, so it understands all 2,000+ named entities plus decimal and hex ones, exactly like a real page would. It happens in a detached document where text can’t become elements and scripts can’t run, so pasting untrusted text is safe. Nothing is uploaded.
Is encoding enough to stop XSS?
Encoding text before you put it inside HTML is a key step against cross-site scripting, but each place has its own rules: URLs, JavaScript strings and CSS need different escaping. In real apps, let your framework’s templates do the escaping for you and use this tool for content, docs and debugging.