HTML entities, escaped and decoded correctly
LOCALAn ampersand in a sentence is just text; the same ampersand followed by amp; with no closing semicolon becomes a broken entity that a browser prints exactly as written. This tool escapes the five markup characters & < > " and ', or, in the wider modes, every character above U+007F, using a name when the built-in table has one and a decimal or hexadecimal reference when it does not. The decoder goes the other way and resolves named, decimal and hexadecimal references in a single pass, leaving anything it cannot recognise untouched. It is meant for people editing templates, reading API responses and repairing text that was escaped twice, not as a sanitizer: entity encoding changes how characters are stored, not whether they are safe to insert into a page.
How it works
- 01
Choose encode or decode
The two tabs are independent directions, and both update while you type. Encode replaces selected characters in the text you paste with entities; decode takes a string that already contains references such as &, © or © and turns them back into the characters they stand for. There is no submit or run button, so you can paste a fragment, read the result and edit the source in place until it looks right.
- 02
Pick how much to escape
In encode mode the scope decides which characters are replaced. Markup only touches the five characters that can break HTML structure: ampersand, less-than, greater-than, double quote and apostrophe. The three non-ASCII modes leave plain ASCII (U+0000–U+007F) alone and also convert everything above U+007F: the named mode uses a name from the built-in table when one exists, such as © or —, and falls back to a numeric reference otherwise; the decimal and hex modes always produce &#NNN; or &#xNNNN; so the output stays readable ASCII.
- 03
Read the counts before you copy
Under the output the tool shows how many characters went in and came out, and how many entities were produced. In decode mode a separate line reports how many references were left untouched because their name is unknown or their code point is not valid. That number is the quickest way to tell a clean decode from one that quietly skipped something: a non-zero count means part of the input is still escaped and needs a closer look.
- 04
Copy the result, keep the source
The copy button puts the current output on the clipboard with no quotes and no wrapper. Copying is also the moment the tool records a single anonymous use count; the text itself is never sent anywhere. There is no history and no saved document, so reloading the page resets everything to the sample. If you are repairing a file, keep your original open and paste the converted version into a second document.
When to use it
Showing code inside a web page
A tutorial that wants to display <div class="box"> has to write <div class="box">, or the browser will render an empty box instead of the source. Paste the snippet here, choose markup only, and the five structural characters are escaped while the rest of the code, including indentation and line breaks, stays as it is. This is the most common reason to reach for the tool and the one place where the narrow scope is exactly right.
Catching double-encoded templates
Mail templates and JSON APIs are often escaped once on the way out and again by a layer that does not know better, so a user sees &quot; instead of a quote. Paste the raw response into decode, look at the number of remaining references, and run it a second time if the first pass removed only one layer. Watching &amp; turn into & and then into & is the signature of double encoding, and it is much faster to confirm here than by reading the pipeline code.
Repairing entities from a CMS or database export
Older CMS versions, CSV exports and migration scripts sometimes store text with entities baked in, so a product name arrives as Café or a price as 5€. Decoding once restores the characters for display or for a new import. If a name such as é is not in the common table, the decoder leaves it unchanged and counts it, which tells you the source used a name outside the built-in set and that you should widen the table or fix the export at the source.
Producing plain ASCII for translation files
Some .po, .properties and subtitle pipelines are safest when the file is pure ASCII, because a stray byte-order mark or an editor saving in the wrong encoding can corrupt accented letters. Switch to the decimal or hex mode and every character above U+007F becomes a reference that survives any ASCII-only transport. Translators can still read the file, and the string table can be converted back to real characters at build time without guessing the original encoding.
Questions
Should I use named entities or numeric references?
Named entities such as © and — are easier for a human to read and to search for, but the HTML5 list is long. Numeric references, © or ©, always work, never depend on a name being spelled correctly and are the safer choice for generated output. In XML only the five predefined entities and numeric references are guaranteed, because HTML5 names do not apply there. Use named when readability matters and the character is common; use numeric when you cannot be sure the name exists.
Why does the tool need the semicolon?
An entity ends at the semicolon. Without it a browser may still guess in some contexts, but the guess is not reliable and can swallow following letters; ¬it; is a classic example that turns into ¬it. This tool follows the strict rule and only recognises a reference that ends with ;, so text such as & without the semicolon is passed through unchanged rather than half-converted. If your input has semicolon-less entities, fix the source before decoding.
Does anything get uploaded?
No. Encoding and decoding are string operations in the current tab. There is no network request, no account, no database and no stored copy of your text. The only thing counted is a single anonymous use event when you press copy, and it contains no content. You can open the browser's network panel and convert a document to confirm that nothing leaves the page.
Can it decode every HTML5 entity?
It decodes any numeric reference whose code point is valid, so 😀 or 😀 resolves whether or not a name exists for it. For names it uses a curated table of common typographic, currency, punctuation and a few Greek and arrow symbols, not the full list of more than 2,000 HTML5 names. An unknown name is left as written and included in the unchanged count, which is an honest signal that the table, not the input, is the limit.
What happens to emoji and other characters outside the BMP?
They are handled through their code points. Emoji sit above U+FFFF, so a decimal reference is a number with six or seven digits, such as 😀, and a hex reference uses the full code point, such as 😀. The decoder rejects values above U+10FFFF and anything in the surrogate range U+D800–U+DFFF, because a surrogate is only half of a pair and cannot stand alone. Valid emoji come back as a single character.
Will encoding break the HTML tags already in my text?
It will escape them if they fall inside the chosen scope, and that is usually the point when you want to display code. In markup-only mode a literal <b> in your input becomes <b>, so it renders as text rather than as bold. If you meant to keep real tags and only escape an inner value, encode that value on its own rather than the whole document. The tool has no HTML parser and makes no judgement about which tags are structural.
How is this different from URL encoding?
HTML entities are for characters inside an HTML document; percent-encoding is for characters inside a URL or a form body. They use different syntax: an entity is &name; or &#NNN;, while a URL escape is %XX with two hex digits per byte of UTF-8. A space is in HTML but %20 in a URL, and an ampersand that separates query parameters must be %26, not &. Applying one where the other belongs produces text that looks escaped but does not work.
Can entity encoding replace input sanitising?
No. Encoding decides how a character is written; it does not decide whether data is trusted. Escaping output is one layer of defence against cross-site scripting, but the authoritative checks belong on the server, where you validate types, lengths and allowed values and use a context-aware escaper for HTML, attributes, scripts and CSS. Relying on this tool to make user input safe is a mistake; treat it as a formatting step, not a security boundary.