How to use this HTML encoder
Paste your text, pick a mode, and press the button. Named entities is the mode to reach for almost every time: it converts only the five characters that are genuinely dangerous or ambiguous in HTML — &, <, >, and the two quote marks — and leaves everything else untouched, so the output stays readable. Numeric entities goes further and also rewrites accented letters and other non-ASCII characters as decimal references, which is useful when a document must survive systems that mishandle UTF-8, such as some email templates and legacy feeds. Decode reverses both, and also understands hexadecimal entities and common names like © and .
One behaviour is worth understanding: decoding happens exactly once. Text that was escaped twice — a common accident when content passes through two systems that each escape it — decodes one layer per click. If your result still contains entities, press Decode again; the tool will not guess how many layers you want removed, because guessing wrong would corrupt text that legitimately discusses entities, like this page does.
Example: a link, escaped
This line of HTML:
escapes in named mode to:
Paste that escaped version into a web page and visitors see the original line as plain text — the browser renders the tag instead of obeying it. The ampersand in “Tom & Jerry” had to become & as well: a bare & in HTML can accidentally start an entity, which is why the ampersand is always the first character any escaper must handle.
When escaping matters
There are three everyday situations. The first is showing code: tutorials, documentation and forum answers all need to display tags without the browser executing them, and escaping is the mechanism. The second is displaying user input: a comment, a name or a review containing <script> must be shown, not run — escaping is the core of cross-site scripting (XSS) prevention, and every web framework does some version of what this page does. The third is attribute values: text placed inside a quoted HTML attribute must not contain the same quote mark unescaped, or the attribute ends early and the rest of the text spills into the tag.
Decoding is the everyday reverse job. View-source text, CMS exports, RSS feeds and database dumps are full of entities; decoding them restores readable copy for editing, searching or republishing. Notice that decoding is not “un-safening” text for display — if you decode user content and then insert it into a page as HTML, you have undone the protection. Decode for reading and editing; re-escape before anything goes back into a page.
Entities you will meet most often
Beyond the five safety characters, a small cast of named entities appears constantly in real content. This decoder understands all of them:
| Entity | Character | Used for |
|---|---|---|
| | non-breaking space | Keeping two words on one line; the space cannot collapse or wrap |
| © | © | Copyright notices in footers |
| ® / ™ | ® / ™ | Registered and trademark symbols after brand names |
| — / – | — / – | Em dashes in prose and en dashes in ranges like 9–5 |
| … | … | A single-character ellipsis, tidier than three dots |
| « / » | « / » | Quotation marks in many European languages |
| € / £ | € / £ | Currency symbols in prices |
| ‘ ’ “ ” | ‘ ’ “ ” | Curly quotes, the typographically correct kind |
Every one of these also exists as a numeric entity — © is © — and the numeric form is the fallback when a name escapes you. Modern pages declare UTF-8 and can simply contain the characters themselves; entities earn their keep in the five safety cases, in attributes, and in formats like XML-based feeds where the same escaping discipline applies.
Frequently asked questions
What is HTML escaping?
HTML escaping replaces characters that have a special meaning in HTML — & < > and quotes — with entity references such as < and &. The browser then displays those characters as text instead of treating them as markup, which is how you show code on a web page safely.
Which characters does this tool escape?
Named mode escapes the five characters that matter for safety and correctness: & becomes &, < becomes <, > becomes >, a double quote becomes " and a single quote becomes '. Numeric mode additionally converts accented letters and symbols into decimal entities like é.
What is the difference between named and numeric entities?
A named entity uses a memorable word — © for ©. A numeric entity uses the character's Unicode number — © in decimal or © in hexadecimal. Both display identically; numeric entities exist for every character, while only some characters have names.
Why does my decoded text still show < in it?
Because the original text was probably escaped twice. If the input contains &lt;, decoding once correctly gives the literal text < — the encoder was applied two times, so you must decode two times to get back to <. This tool decodes exactly once per click, which is the safe behaviour.
Does escaping HTML make user input safe from XSS?
Escaping is the core defence: when user text is escaped before being placed in a page, the browser shows it as inert text rather than running it as markup or script. It is necessary but not the whole story — safe handling also depends on where the text is inserted (attribute, script block, URL), so developers should use their framework's built-in escaping for each context.
Can I decode entities copied from a web page's source?
Yes. Paste the source text into Decode mode and named, decimal and hexadecimal entities are all converted back to the characters they represent, including common ones like , © and —.
Why does the encoded text get longer?
Each special character is replaced by a reference of four to eight characters — < becomes the four characters <, and é becomes the six characters é. Ordinary letters, digits and spaces pass through unchanged in named mode, so normal text grows only a little.
Is my text uploaded to a server?
No. The conversion runs in JavaScript inside your own browser. Nothing you paste is sent anywhere, stored or logged, and the tool works offline once the page has loaded.
Should I escape text before putting it in an HTML attribute?
Yes — quotes especially. An unescaped double quote inside a double-quoted attribute ends the attribute early and lets the rest of the text spill into the tag. Named mode escapes both quote types, so its output is suitable for attribute values as well as element content.