How to use the HTML Entity Encoder tool
- Paste your text or HTMLEnter the text to encode, or HTML code full of entities to decode.
- Choose Encode or DecodeEncode turns special characters into entities; Decode turns entities back into characters.
- Pick an encoding styleEscape only the five HTML special characters, or also convert accents and symbols to named, decimal or hex entities.
- Copy the resultCopy the output, or click “Use result as input” to reverse the operation.
Features
- Safe escapingConverts & < > " and ' so user text can’t break your HTML.
- Three entity stylesNamed (©), decimal (©) or hexadecimal (©) for non-ASCII characters.
- Complete decodingUses the browser’s own HTML parser, so every named entity is recognized.
- Emoji-safeCharacters outside the basic plane, like emoji, become a single correct entity.
- Non-breaking spacesOptionally keep double spaces visible with .
What are HTML entities?
Some characters have a special meaning in HTML. A < starts a tag and an & starts an entity, so writing them directly in text can break a page or create security holes. HTML entities are codes that represent these characters safely: < displays as <, and & displays as &. Entities can also represent characters that are hard to type, such as © or €.
The five characters you must escape
| Character | Entity | Why |
|---|---|---|
| & | & | Starts every entity |
| < | < | Starts a tag |
| > | > | Ends a tag |
| " | " | Ends attribute values in double quotes |
| ' | ' | Ends attribute values in single quotes |
Common entities
| Symbol | Named | Decimal |
|---|---|---|
| (space) | |   |
| © | © | © |
| ® | ® | ® |
| ™ | ™ | ™ |
| € | € | € |
| £ | £ | £ |
| — | — | — |
| … | … | … |
| “ ” | “ ” | “ ” |
Do I still need entities for accents and symbols?
Not usually. Modern pages are saved as UTF-8 (with <meta charset="utf-8">), so characters like é, ñ, € and emoji can be written directly. Entities for non-ASCII characters are mainly useful in old systems, email templates, XML that must stay ASCII, or when you can’t be sure about the file’s encoding. The five special characters above, however, must always be escaped in text and attributes.
Security note
Escaping user input before inserting it into HTML is a key defence against cross-site scripting (XSS). In real applications, let your framework’s templating engine do this automatically, for example Laravel Blade’s {{ }}, React’s JSX or Django templates. To encode text for URLs instead, use the URL Encoder & Decoder; for binary data, use the Base64 Encoder.