HTML Entity Encoder & Decoder
Convert special characters to HTML entities and back. Supports named and numeric entities.
Common HTML Entities
About this tool
HTML entities are codes that represent special characters in HTML. They prevent characters like <, >, and & from being interpreted as HTML markup, which is essential for safely displaying user-generated content.
Preventing XSS attacks by escaping user input, displaying code snippets in HTML, correctly rendering special symbols and accented characters, and writing valid HTML for characters outside ASCII.
Frequently asked questions
What are the most important HTML entities?
The five critical entities for web security are: & for &, < for <, > for >, " for double quote, and ' for single quote. Always escape these when inserting user data into HTML.
What is the difference between named and numeric entities?
Named entities use a descriptive name like & or ©. Numeric entities use the code like & (decimal) or & (hex). Numeric entities work for any Unicode character.
Should I use entities or UTF-8?
If your document declares UTF-8 (all modern pages should), use UTF-8 directly and only escape the five security-critical characters. Entities are still needed for <, >, &, and quotes.