Back to Tools
HTML Entity Reference
Common Named Entities
Char
Named Entity
Numeric
&
&
&
<
<
<
>
>
>
"
"
"
'
'
'
©
©
©
®
®
®
Encoding Types
- Basic: Only &, <, >, ", ' characters
- Named: Human-readable entity names
- Numeric: Decimal number codes
- Hex: Hexadecimal number codes
- All: Complete entity encoding
Security Benefits
- Prevents XSS attacks
- Safe display of user content
- Protects against code injection
- Ensures proper HTML rendering
- Maintains data integrity
HTML Entity Guidelines
When to Encode
- Displaying user-generated content
- Embedding text in HTML attributes
- Showing code examples in HTML
- Preventing script execution
- International character support
Important Notes
- Double encoding can cause issues
- Different contexts need different encoding
- Some frameworks auto-encode
- URL parameters need URL encoding
- JSON requires different escaping
Best Practices
- Always encode untrusted input
- Use appropriate encoding for context
- Test with special characters
- Validate after decoding
- Consider internationalization