HTML Entity Converter
What entities are for, in one idea
HTML reserves a handful of characters for its own grammar: < and > build tags, & starts a reference, and the quotes delimit attributes. An entity is how you write one of those characters when you mean it as text rather than grammar: to show "<b>" on a page instead of making bold text, you write <b>. The same mechanism extends to any character in Unicode through numeric references, which is how symbols survived the era before UTF-8 was safe to assume. Modern pages declare UTF-8 and can carry almost any character literally, so today entities have three main jobs: the essential five escapes (always), safety in encoding-hostile pipelines like email and XML (often), and invisible-character control, such as the non-breaking space (sometimes). This converter encodes with the essential five or with full numeric encoding, and decodes using the browser's own parser, so every named reference in the HTML standard, all two thousand plus of them, resolves exactly as it would on a real page.
Common entities worth knowing
| Character | Named | Decimal | Hex |
|---|---|---|---|
| & ampersand | & | & | & |
| < less-than | < | < | < |
| € euro | € | € | € |
| © copyright | © | © | © |
| — em dash | — | — | — |
| → arrow | → | → | → |
| non-breaking space | |   |   |
Entities inside attributes and URLs
The rules tighten inside attribute values. A double-quoted attribute must not contain a literal double quote, which is why " exists; a URL inside href brings its own trap, because a query string's & separator is also HTML's reference starter. Strictly, an ampersand in an attribute URL should be written & (a link to ?a=1&b=2 in source form), and browsers forgive the omission when what follows is not a valid reference, but forgiveness is not a spec: validators flag it, and a parameter named like an entity (a query value starting with "copy=" can collide with © in sloppy parsing) can corrupt a link silently. Inside JavaScript strings and JSON embedded in pages, entities are the wrong tool entirely: HTML-escaping does not make a script context safe, and JSON wants backslash escapes, not references.
Why entities are a security boundary, not just formatting
Every cross-site scripting (XSS) defence starts here. When user text is inserted into a page without encoding, a comment that contains a script tag or an event-handler attribute stops being text and becomes code running in other visitors' browsers. Encoding the five essentials converts that payload back into inert, visible text: the browser displays the tag instead of obeying it. Two subtleties separate real protection from theatre. First, encoding must match the context: HTML body, attribute, URL and script contexts each need their own escaping, and one size does not fit all. Second, decoding is equally dangerous in reverse: a system that decodes entities after sanitising can resurrect a payload the sanitiser thought it had neutralised (javascript: is just "javascript:" after one decode). If you take one rule from this page: encode on output, in the right context, as the last step before the browser.
Frequently asked questions
What are the five essential HTML entities?
Ampersand becomes &, less-than <, greater-than >, double quote ", and apostrophe ' (or ' in XML). These five are the ones that can break markup or attribute values if written literally. Everything else, accented letters, currency signs, arrows, can be written directly as UTF-8 characters in a modern page, though entities remain useful in contexts like email templates and XML feeds where encodings are unreliable.
What is the difference between named, decimal and hex entities?
They are three spellings of the same character. The euro sign can be written as the named reference €, the decimal reference €, or the hex reference €: 8364 and 20AC are the same code point in base 10 and base 16. Named references exist only for a defined set of characters and are the most readable; numeric references work for every Unicode character and are the safest choice in generated content.
Why does my text show & on the page?
Because it was encoded twice. Something in the chain (a CMS, a template, a database export) escaped text that was already escaped, turning & into &, which the browser faithfully displays as the literal text '&'. The fix is to decode once before re-encoding, or find the layer that double-escapes. This page's decoder run twice will show you whether you are looking at single or double encoding: if decoding once still leaves entities, it was encoded twice.
Do I need to encode accented characters and emoji?
Not in a UTF-8 page with a correct charset declaration, which is the modern default: café and an emoji can be written literally. Encoding them as numeric references is still useful when content passes through systems that mangle encodings (older email clients, some RSS and XML pipelines, databases in latin1), or when you want source that is pure ASCII. The trade-off is readability: é is bulletproof and unreadable, é is the reverse.
Is an entity and when should I use it?
Yes, is the non-breaking space (code point 160), which prevents a line break at that point and, unlike a normal space, is not collapsed by HTML rendering. It is legitimate for keeping units with numbers (10 kg) and names together. It is abused as a layout tool for indentation and spacing, a 1990s habit that CSS margins and padding replaced; a page full of is a maintenance smell, and screen readers handle runs of them poorly.
Related tools
Entity handling and examples last verified: 23 November 2026. Everything is calculated in your browser — nothing you type is sent anywhere.