HTML Entity Encoder / Decoder
Encode and decode HTML entities instantly. Convert special characters to safe HTML entities and back. Free online tool — no signup required.
| Character | Entity Name | Entity Number | Description |
|---|
What Are HTML Entities?
HTML entities are special codes that represent reserved characters in HTML. Characters like <, >, and & have special meaning in HTML, so they must be encoded when you want to display them as text rather than interpret them as markup.
When to Encode HTML
Always encode user-generated content before inserting it into HTML to prevent XSS (Cross-Site Scripting) attacks. Also encode content for display in code blocks, documentation, and anywhere raw HTML characters need to appear as visible text.
FAQ
Which characters must be encoded in HTML?
At minimum, you must encode & (ampersand), < (less than), > (greater than), and " (double quote inside attributes). Encoding single quotes and slashes adds extra safety.
What is the difference between named and numeric entities?
Named entities like & are easier to read. Numeric entities like & use the Unicode code point and work for any character, including those without a named entity.
RELATED TOOLS