HTML Entity Encoder / Decoder
Escape text so it displays literally in HTML — turning <, >, &, " and ’ into entities — or decode entities back to characters. Named, decimal and hex references are all supported, and it runs entirely in your browser.
- 🔒 100% private — no uploads
- 🆓 Free, no watermark
- 📱 Works on any device
How to encode
- 1
Paste your text or HTML
Type directly or paste your text into the box. It’s processed right in your browser — nothing is uploaded to a server.
- 2
See the result instantly
The tool updates live as you type, showing the encoded or decoded result with no “submit” button or waiting.
- 3
Copy or keep going
Copy the result with one click, tweak your input, or clear it and start again. Free, instant and private.
Why use HTML Entity Encoder / Decoder?
Encode & decode
Escape the five markup-significant characters for safe HTML, or resolve entities back to plain text — switch direction with one click.
Named, decimal & hex
Decoding resolves named references plus decimal (&) and hex (&); encoding can optionally turn every non-ASCII character into a numeric reference.
100% private
Everything runs locally in your browser with JavaScript. Your text is never uploaded, stored or seen by anyone — it even works offline.
Works on any device
No install and no account. Runs in any modern browser on Windows, macOS, Linux, Android or iPhone.
Showing code as code
The moment you want a page to display <div> as text rather than create a div, you need entities: <div>. The same goes for a bare & in prose (it starts an entity reference) and for quotes inside attribute values. Writing documentation, blog posts or HTML examples inside HTML is the classic use — paste the snippet here, encode, and drop the result into your markup.
Escaping is also a security boundary
When user-supplied text is inserted into a page without escaping, a “name” like <script>… stops being text and starts being code — that’s cross-site scripting (XSS). Escaping the five markup-significant characters (& < > " ') at output time neutralizes it. In real applications your framework should do this automatically; this tool is for the manual cases — templates, emails, generated snippets — and for checking what a suspicious encoded string actually says.
Frequently asked questions
What are HTML entities?
HTML entities are sequences that represent characters which would otherwise be parsed as markup or are hard to type — for example & for &, < for <, or é for é. Encoding them makes the characters display literally instead of affecting the page.
Which characters get escaped?
The five markup-significant characters: ampersand, less-than, greater-than, double quote and apostrophe. You can also choose to encode every non-ASCII character to a numeric reference for maximum compatibility.
Is my text uploaded to a server?
No. The tool runs entirely in your browser, so whatever you type or paste stays on your device. It’s safe for code, tokens and confidential text, and works offline once loaded.