HTML Encoder / Decoder
Encode or decode HTML entities with various options
Result
About HTML Encoding
HTML encoding converts special characters into their corresponding HTML entities to ensure they are displayed correctly in web browsers. This is necessary because certain characters have special meaning in HTML, such as < and > which define tags.
HTML Entity Types
- Named Entities - Human-readable names for common characters (e.g.,
<
for <) - Decimal Entities - Numeric representation using decimal values (e.g.,
<
for <) - Hexadecimal Entities - Numeric representation using hex values (e.g.,
<
for <)
When to Use HTML Encoding
- When displaying user-generated content on a webpage
- When you need to display HTML code as text rather than having it rendered
- When embedding special characters in HTML documents
- When working with internationalized content that contains non-ASCII characters
- When preventing XSS (Cross-Site Scripting) attacks by sanitizing user input
Common HTML Entities
Character | Named Entity | Decimal Entity | Hex Entity | Description |
---|---|---|---|---|
< | < | < | < | Less than sign |
> | > | > | > | Greater than sign |
& | & | & | & | Ampersand |
" | " | " | " | Double quote |
' | ' | ' | ' | Single quote (apostrophe) |
© | © | © | © | Copyright symbol |
® | ® | ® | ® | Registered trademark |
€ | € | € | € | Euro sign |