HTML Entity Encoder & Decoder
Encode HTML special characters to entities, decode entities back to characters. Prevent XSS, display symbols, sanitize user input.
Encoded Result
<script>alert("Hello")</script>
Quick Examples
Common HTML Entities
< → <
> → >
& → &
" → "
' → '
© → ©
® → ®
€ → €
£ → £
¥ → ¥
¢ → ¢
° → °
Entity Formats
Named Entities
& Ampersand
< Less than
> Greater than
© Copyright
Numeric Entities
< Decimal code
< Hex code
Emoji support
😀 Hex emoji
Why Encode?
Prevent XSS attacks
Display in HTML context
Sanitize user input
Show code examples
Security Note
Encoding HTML entities prevents XSS by making <script> display as text instead of executing.
Always encode user input before displaying in HTML.
Use Content Security Policy (CSP) for additional protection.