HTML entities encoder and decoder
Escape text for HTML in the format you prefer and decode entities exactly as a browser would.
89 → 115 characters
How it works and limits
- The decoder follows the HTML standard character reference algorithm: all 2,125 named entities, the 106 legacy ones that do not need a semicolon, numeric references and the Windows-1252 table for codes 128-159.
- Control characters U+0080 to U+009F cannot be written as numeric references (browsers remap them), so the encoder leaves them as they are.
- Encoding & < > and quotes is enough to insert text into HTML or quoted attributes. It does not replace context-specific escaping for JavaScript, CSS or URLs.
- Everything happens in your browser.
Built by
Miguel Ángel Colorado Marin (MACM)
Built by
Miguel Ángel Colorado Marin (MACM)
Full-Stack Developer · Guadalajara, España
I develop web apps, digital tools and full projects — from design to deployment.
HTML entities look trivial until an &amp; shows up in an email, a © swallows part of a URL or a zero-width space breaks a text comparison. This converter implements the HTML standard character reference algorithm with the full table of 2,125 entities, so it decodes exactly like a browser, including edge cases of entities without a semicolon inside attributes. When encoding you choose what to escape and in which format, and it also detects double encoding and the invisible characters that often sneak in when copying from Word or the web.
Features
- ✓All 2,125 named entities from the HTML standard, including multi-character ones
- ✓Browser-exact decoding: entities without semicolon, the attribute rule and the Windows-1252 table
- ✓Three encoding scopes: only & < > and quotes, plus non-ASCII, or every symbol
- ✓Named, decimal or hexadecimal format with control over quotes and apostrophe
- ✓Detects double encoding (&lt;) and decodes every layer at once
- ✓Finds invisible and bidi control characters: zero-width spaces, NBSP, BOM or RTL override
- ✓List of found references with counts and a warning for those missing a semicolon
- ✓Entity finder by name, character or code point with one-click copy
How do I encode or decode HTML entities?
- 1
Choose the direction
Encode turns text into entities; decode turns entities into text.
- 2
Paste the content
The result updates as you type.
- 3
Adjust the options
When encoding, pick scope, format and quotes. When decoding, enable attribute context or every layer if there is double encoding.
- 4
Review warnings and copy
Check references, invisibles and double encoding, then copy the result.
Frequently asked questions
Which characters must be escaped in HTML?
For text inside tags, & and < are enough, although > is usually escaped too. Inside a quoted attribute you must also escape the delimiting quotes. That is sufficient: accents and the euro sign do not need entities if the page is UTF-8.
Why does ©= in a URL become ©=?
Because copy is one of the 106 legacy entities browsers decode without a semicolon. In attributes the standard skips it when the next character is = or alphanumeric, but in text it does not. Enable "Attribute context" to see the difference and always escape & as &.
What is double encoding?
It happens when already escaped text is escaped again, and < ends up as &lt;, which shows literally on screen. The tool counts the layers and can decode all of them.
Named or numeric entities?
They are equivalent for browsers. Named ones are more readable; numeric ones work in XML and any context where the entity name is not known, for example RSS feeds.
Does encoding entities protect against XSS?
It protects when inserting text into the HTML body or quoted attributes. It is not enough inside a <script>, an event attribute, CSS or a URL, where each context needs its own escaping.
Related tools
Embed HTML Entities Encoder and Decoder on your site
Add HTML Entities Encoder and Decoder to any web page with a simple iframe. Free, with attribution to miguelacm.es.
<iframe
src="https://miguelacm.es/embed/html-entities"
width="100%"
height="700"
frameborder="0"
title="HTML Entities Encoder and Decoder — miguelacm.es"
></iframe>View embed in new tab →