HTML Entity Encoder / Decoder — Free, Instant, No Upload
Encode special characters like <, >, &, and " to safe HTML entities, or decode entities back to readable text. Supports named entities, decimal numeric (&#NNN;), and hex numeric (&#xHH;) forms. Everything runs in your browser — nothing is sent to a server.
How to use this tool
- Paste your text or HTML into the input field.
- Toggle whether to escape or unescape the entities.
- Copy the converted output.
About HTML Entity Encoder / Decoder
The HTML Entity Encoder / Decoder converts text to and from HTML entities, the &name; or &#number; escape sequences that let reserved characters appear as visible text instead of being parsed as markup. Pick Encode or Decode, paste your text, and the converted result appears live with a Copy button. It is the tool you use to safely show angle brackets in a code example, paste content into HTML without it being interpreted, or read back content that was already escaped.
In encode mode the tool escapes the characters that matter for HTML. Ampersand becomes &, and the less-than, greater-than, double-quote, and single-quote characters are escaped as well. By default these use named entities such as < and ", but ticking Use numeric entities switches them to decimal numeric form like < and > (the single quote is always emitted as the numeric '). Any character above code point 126, meaning non-ASCII characters such as accented letters or symbols, is always escaped as a decimal numeric entity regardless of that toggle, which makes the output safe to embed even in contexts with limited character-set support. Decode mode is more forgiving: it recognizes decimal entities (&#NNN;), hexadecimal entities (&#xHH;), and a built-in table of common named entities including &, <, >, ", , ©, ™, the en and em dashes, smart quotes, and currency symbols. Unrecognized named entities are left untouched rather than corrupted.
Use it when preparing code or text for display inside HTML, sanitizing snippets you are pasting into a CMS, debugging double-escaping issues, or converting escaped content back to plain text for editing.
The main thing to understand is the asymmetry between the two modes. Encoding always converts high code points to numeric entities, so a round-trip through encode then decode is reliable, but it is not a minimal transformation: typing an accented name will come back as numeric entities. The decode named-entity table is curated to the common set, so a rare named entity outside that list passes through unchanged instead of being decoded. Everything runs locally in your browser with nothing sent to a server.
Frequently Asked Questions
- What is an HTML entity?
- It is an escape sequence that starts with & and ends with ; used to represent a character that would otherwise be interpreted as markup or that is hard to type. For example < displays a less-than sign and & displays an ampersand, instead of those characters being treated as the start of a tag or entity.
- What is the difference between named and numeric entities?
- Named entities like < are human-readable; numeric entities like < reference the character by its code point and are highly portable. In this tool the Use numeric entities toggle controls which form is used for the core reserved characters, while non-ASCII characters are always emitted as numeric entities.
- Why are accented or special characters always turned into numeric entities?
- Any character above code point 126 is escaped as a decimal numeric entity during encoding. This guarantees the output stays valid even where the character set is restricted, so it is intentional rather than a bug. Decoding will turn those numeric entities back into the original characters.
- Which named entities can the decoder handle?
- It decodes a curated set of common ones including &, <, >, ", ', , ©, ®, ™, the en and em dashes, smart quotes, the ellipsis, and currency symbols. It also decodes all decimal (&#NNN;) and hexadecimal (&#xHH;) numeric entities.
- What happens to a named entity the decoder doesn't recognize?
- It is left exactly as it appears rather than being mangled. Numeric entities are always decoded, so if you need a rare named entity converted, you can decode its numeric equivalent instead.
- Will encoding then decoding return my original text?
- Yes. Because encoding escapes reserved characters and all non-ASCII to numeric entities, and decoding reverses both forms, a round-trip is reliable. Just note that the encoded form may look more verbose than your original if it contained accented characters.
- Is anything sent to a server?
- No. All encoding and decoding happens locally in your browser, so the text you paste never leaves your device.
Embed this tool on your site
Free. One line of HTML — the tool runs in your visitor's browser, no data sent to anyone.
<iframe src="https://brevio.pro/embed/html-entities" width="100%" height="600" loading="lazy" style="border:1px solid #e5e5e5;border-radius:8px" title="HTML Entity Encoder / Decoder — brevio"></iframe> <p style="font:12px/1.4 sans-serif"><a href="https://brevio.pro/tools/html-entities">HTML Entity Encoder / Decoder</a> by <a href="https://brevio.pro">brevio</a></p>