HTML Entity Encoder / Decoder
Encode & decode HTML entities for safe HTML rendering
No data is sent to any server — everything runs client-side
Plain Text
Text with special characters
Encoded Output
HTML-safe entities
What Are HTML Entities?
HTML entities are special character sequences that represent reserved characters in HTML. Characters like <, >, and & have special meaning in HTML — the browser interprets them as tag delimiters and entity markers. To display these characters as text, you must encode them as entities.
There are two types: named entities (like &) and numeric entities (like &). Named entities are human-readable, while numeric entities can represent any Unicode character.
Common HTML Entities Reference
| Character | Named | Numeric | Description |
|---|---|---|---|
| & | & | & | Ampersand |
| < | < | < | Less than |
| > | > | > | Greater than |
| " | " | " | Double quote |
| © | © | © | Copyright |
| ™ | ™ | ™ | Trademark |
| — | — | — | Em dash |
| |   | Non-breaking space |
Why Encoding Matters: XSS Prevention
HTML entity encoding is the primary defense against Cross-Site Scripting (XSS) attacks. When user input is rendered as HTML without encoding, an attacker can inject <script> tags that execute arbitrary JavaScript in other users' browsers. Encoding ensures that < becomes <, preventing the browser from interpreting it as markup.
Related Tools
Built by JDApplications