HTML Entities Encoder / Decoder
Encode and decode HTML entities instantly
Common HTML entities referenceโพ
| Character | Named entity | Numeric |
|---|---|---|
| & | & | & |
| < | < | < |
| > | > | > |
| " | " | " |
| ' | ' | ' |
| ยฉ | © | © |
| ยฎ | ® | ® |
| โข | ™ | ™ |
| โฌ | € | € |
| ยฃ | £ | £ |
| โ | — | — |
| โฆ | … | … |
| ยฐ | ° | ° |
| ร | × | × |
| รท | ÷ | ÷ |
HTML Entities Encoder & Decoder
This tool converts special characters to their HTML entity equivalents (encoding), and converts HTML entities back to their original characters (decoding). It supports named entities (&, <, ©, etc.) as well as decimal (©) and hexadecimal (©) numeric entities.
Why HTML Entity Encoding Matters for Security
Proper HTML encoding is one of the most important defenses against Cross-Site Scripting (XSS) โ the #1 web vulnerability category in the OWASP Top 10. When user-supplied text is inserted into an HTML page without escaping, an attacker can inject HTML tags or JavaScript that the browser executes. Encoding every instance of <, >, &, ", and ' prevents this.
Essential Entities
&โ & (ampersand โ always encode in HTML)<โ < (less-than / open tag)>โ > (greater-than / close tag)"โ " (double quote โ encode inside attributes)'โ ' (single quote โ encode inside single-quoted attributes) โ non-breaking space
Numeric HTML Entities
Any Unicode character can be referenced by its decimal code point: &#NNN; โ for example, © renders as ยฉ. The hex form is &#xHHH; โ for example, © is also ยฉ. This is useful for characters that have no standard named entity or for embedding emoji in legacy HTML.
HTML Entities vs. JavaScript String Escaping
HTML entity encoding is specifically for characters inside HTML documents. It is different from JavaScript string escaping (backslash sequences like \n, \u0041) and from URL percent-encoding (%20). Use each encoding in the right context: HTML encoding for HTML output, URL encoding for query strings and paths, and JS escaping for JSON or inline script strings.