About the HTML Entity Encoder
Characters like <, > and & have special meaning in HTML. To display them literally — for example code samples in a blog post — they must be escaped as entities. Escaping user input is also the first line of defence against cross-site scripting (XSS).
Features
- Escape only the five HTML-special characters, or all non-ASCII
- Named (
©), decimal or hex entities - Decodes all 2,000+ named HTML5 entities
- Unicode and emoji safe
How to use it
- Choose Encode or Decode.
- Select which characters to encode and the entity style.
- Copy the output.
Frequently asked questions
Is escaping enough to prevent XSS?
Escaping is correct for HTML text and quoted attribute values, but URLs, JavaScript and CSS contexts need context-specific encoding. Use your framework’s auto-escaping whenever possible.