HTML Entity Encoder/Decoder
Encode special characters to HTML entities or decode them back.
Entity Format (for encoding)
Uses named entities like & < > " where available
Result will appear here...
Common HTML Entities
| Character | Named | Numeric |
|---|---|---|
| & | & | & |
| < | < | < |
| > | > | > |
| " | " | " |
| ' | ' | ' |
| (nbsp) | |   |
| © | © | © |
| ® | ® | ® |
| ™ | ™ | ™ |
| € | € | € |
About HTML Entity Encoder/Decoder
HTML Entity Encoder/Decoder converts special characters to their HTML entity equivalents and decodes entities back to the original characters. Encodes characters like < > & " ' to < > & " ' and vice versa.
Encoding user-supplied content before rendering it in HTML is a critical security practice — it prevents cross-site scripting (XSS) attacks where malicious HTML or JavaScript is injected into your pages. This tool helps you understand and apply correct encoding.
Also handles numeric entities (<) and named entities (<) in both directions.
Features
- ✓Encode HTML special characters to entities
- ✓Decode HTML entities back to characters
- ✓Handles named and numeric entities
- ✓Prevents XSS by showing safe encoded output
- ✓Real-time encoding/decoding
Common Use Cases
- →Encoding user input before rendering in HTML
- →Decoding HTML entities in content for editing
- →Understanding XSS prevention techniques
- →Encoding email addresses against scrapers