HTML Entities Encoder/Decoder
Common HTML Entities
How to Use
- Select Encode or Decode mode
- Enter your text or HTML entities
- Choose encoding options (numeric, hex, encode all)
- Click Encode/Decode button
- Copy the result to use in your code
Why Encode HTML Entities?
- Prevent XSS attacks - Safely display user-generated content
- Display special characters - Show < > & correctly
- Valid HTML - Ensure your markup is well-formed
- Email safety - Some email clients require encoded characters
- Database storage - Safely store text containing HTML
- API responses - Properly escape JSON/XML content
Frequently Asked Questions
What are HTML entities?
HTML entities are special codes used to display reserved characters (<, >, &, etc.) and special symbols in HTML. They start with & and end with ; like < for <.
When should I encode HTML entities?
Encode when displaying user input to prevent XSS attacks, when you need special characters in HTML content, or when characters might break your HTML structure.
What's the difference between named and numeric entities?
Named entities use readable names (&, <) while numeric entities use character codes (&, <). Numeric entities support more characters.
Should I encode all characters?
No, only encode characters that have special meaning in HTML (<, >, &, ", ') or aren't in the standard ASCII range. Over-encoding makes content harder to read.
Are HTML entities case-sensitive?
Yes, named entities are case-sensitive. & is valid but & is not. Numeric entities work regardless of case.