HTML Entity Encoder / Decoder

Convert special characters to HTML entities and vice versa

Common HTML Entities

&
&
<
&lt;
>
&gt;
"
&quot;
'
&#39;
©
&copy;
®
&reg;
&trade;
&euro;
£
&pound;
¥
&yen;
¢
&cent;
§
&sect;
°
&deg;
±
&plusmn;
×
&times;
÷
&divide;
&para;

What are HTML Entities?

HTML entities are special codes used to display reserved characters in HTML. Characters like <, >, and & have special meaning in HTML, so they must be encoded to display them as text.

Common HTML Entities

CharacterNamed EntityNumeric EntityDescription
<&lt;&#60;Less than
>&gt;&#62;Greater than
&&amp;&#38;Ampersand
"&quot;&#34;Double quote
'&apos;&#39;Single quote
&nbsp;&#160;Non-breaking space
©&copy;&#169;Copyright

Why Encode HTML Entities?

🛡️

Prevent XSS Attacks

Encoding prevents malicious scripts from executing in user-generated content

📄

Display Code Examples

Show HTML code as text without the browser interpreting it as markup

Valid HTML

Ensure your HTML validates correctly with properly encoded special characters

🌐

Cross-Browser

Entities work consistently across all browsers and character encodings

FAQ

What's the difference between named and numeric entities?

Named entities like &lt; are easier to read. Numeric entities like &#60; work for any Unicode character, even those without named equivalents.

When should I encode HTML?

Always encode user-generated content, code examples, and any text containing < > & or " characters to prevent XSS vulnerabilities and display issues.