HTML Entity Encoder
Code Tools
Encode special characters to HTML entities or decode entities back to characters. Essential for displaying code snippets and preventing XSS.
Text to Encode
Encoded Output
Result will appear here...
Common HTML Entities
Bidirectional
Encode text to entities or decode entities back to readable text with a single click.
Security
Encoding special characters helps prevent XSS attacks by escaping potentially dangerous characters.
Multiple Formats
Support for named entities (&), numeric (&), and hexadecimal (&) formats.
Why Use HTML Entities?
Displaying Code
Show HTML tags as text rather than having the browser interpret them. <div> instead of rendering a div.
Special Characters
Display symbols that aren't on your keyboard like © ® ™ → ← € £ and mathematical symbols.
Prevent XSS
Encoding user input prevents malicious scripts from executing. Essential for security.
Character Encoding Issues
Entities work regardless of the document's character encoding, ensuring consistent display.
Essential HTML Entities
| Character | Named | Numeric | Description |
|---|---|---|---|
| & | & | & | Ampersand |
| < | < | < | Less than |
| > | > | > | Greater than |
| " | " | " | Double quote |
| ' | ' | ' | Single quote |