HTML Entities
Encode special characters to HTML entities (named, decimal or hex) and decode entities back to text. Escape HTML safely, entirely offline.
Common HTML entities
Click any entity or character to copy it.
| Char | Named | Decimal | Hex | Description |
|---|---|---|---|---|
| Ampersand | ||||
| Less-than sign | ||||
| Greater-than sign | ||||
| Double quotation mark | ||||
| Apostrophe (single quote) | ||||
| Non-breaking space | ||||
| En space | ||||
| Em space | ||||
| Thin space | ||||
| Soft hyphen (invisible break hint) | ||||
| Copyright sign | ||||
| Registered trademark | ||||
| Trademark sign | ||||
| Euro sign | ||||
| Pound sterling | ||||
| Yen sign | ||||
| Cent sign | ||||
| Section sign | ||||
| Pilcrow (paragraph sign) | ||||
| Degree sign | ||||
| Plus-minus sign | ||||
| Multiplication sign | ||||
| Division sign | ||||
| En dash | ||||
| Em dash | ||||
| Horizontal ellipsis | ||||
| Left single quotation mark | ||||
| Right single quotation mark / apostrophe | ||||
| Left double quotation mark | ||||
| Right double quotation mark | ||||
| Left-pointing double angle quote | ||||
| Right-pointing double angle quote | ||||
| Bullet | ||||
| Middle dot | ||||
| Left arrow | ||||
| Right arrow | ||||
| Up arrow | ||||
| Down arrow | ||||
| Left-right arrow | ||||
| Not equal to | ||||
| Less-than or equal to | ||||
| Greater-than or equal to | ||||
| Infinity | ||||
| Square root | ||||
| Fraction one half | ||||
| Fraction one quarter | ||||
| Fraction three quarters | ||||
| Micro sign | ||||
| Black heart suit | ||||
| Check mark |
What is the HTML Entity Encoder & Decoder?
HTML entities (character references) let you write characters that would otherwise be interpreted as markup or that are hard to type. A named reference like < or © uses a memorable name, while numeric references such as © (decimal) or © (hexadecimal) can express any Unicode code point. Escaping the five HTML-special characters — & < > " and ' — is the minimum needed to display user text safely inside HTML and attribute values.
This encoder works on whole Unicode code points rather than UTF-16 units, so emoji and other characters outside the Basic Multilingual Plane become a single correct reference (😀 → 😀) instead of two broken surrogate halves. Choose whether to escape only the HTML-special characters, also every non-ASCII character (useful for legacy pipelines or ASCII-only email templates), or every character. Named mode uses a name only where HTML5 defines one that decodes back to the exact same character, and falls back to a numeric reference otherwise.
The decoder recognizes all 2,231 named references from the HTML5 specification as well as decimal and hex references, and follows the browser's real parsing rules — including legacy names without a semicolon (©2024 → ©2024) and the Windows-1252 remapping of €–Ÿ. Decoding uses an inert, detached document, so pasted markup is never rendered and scripts never run. Unknown names such as a mistyped &nbps; are listed so you can spot typos.
Frequently asked questions
- Which characters must be escaped in HTML?
- In text content, & and < must be escaped (> is recommended). Inside attribute values you also need to escape the quote character that delimits the value, so escaping all five — & < > " ' — is the safe default this tool uses.
- Named, decimal or hex — which should I use?
- All three are equivalent to browsers. Named references (é) are easiest to read, decimal (é) and hex (é) work for every Unicode character, including ones without a name such as most emoji. Hex matches the U+ notation used in Unicode charts.
- Why does my text turn into &amp;?
- That is double-encoding: text that was already escaped went through the encoder a second time, so the & that starts each entity was escaped too and & turned into &amp;. Enable “Don't double-encode existing entities” to leave existing references untouched, or decode the text first.
- Is ' valid HTML?
- Yes. ' is part of HTML5 and XML. It was not defined in HTML 4, so if you target very old HTML 4 parsers use the numeric form ' (choose Decimal) instead.
- Does HTML escaping protect against XSS?
- Escaping & < > " ' prevents injected text from creating tags or breaking out of quoted attributes, which covers HTML body and attribute contexts. It is not sufficient inside JavaScript (script blocks, inline event handlers), CSS or URLs (for example javascript: links); those contexts need their own encoding or validation.
- Is my text sent to a server?
- No. Encoding and decoding happen entirely in your browser with JavaScript, so you can safely process private templates or content even when offline.
Related tools
- Case ConverterConvert text to UPPERCASE, lowercase, Title Case, camelCase, PascalCase, snake_case, kebab-case and more. Instant, free and fully offline.
- Word & Char CounterCount words, characters, sentences and paragraphs, estimate reading and speaking time, check platform limits and analyze keyword density — all in your browser.
- Lorem IpsumGenerate lorem ipsum placeholder text by paragraphs, sentences or words for mockups, wireframes and UI prototypes. Copy as plain text or HTML.
- Text CleanerClean messy copy-pasted text: strip extra whitespace, empty lines, HTML tags, invisible characters and duplicate lines in one click.
- Text DiffCompare two texts side by side or as a unified diff and highlight differences by line, word or character. Handles thousands of lines, privately and offline.
- Slug GeneratorTurn titles and headlines into clean, SEO-friendly URL slugs with transliteration, custom separators and bulk mode.