HTML Encoder

Encode & decode HTML

Common entities:
&&
<&lt;
>&gt;
"&quot;
'&#39;
/&#x2F;
`&#x60;
=&#x3D;

Frequently Asked Questions

What is HTML encoding?
HTML encoding converts special characters into HTML entities to prevent them from being interpreted as HTML code. For example, < becomes &lt; and > becomes &gt;. This is essential for displaying user input safely.
Why is HTML encoding important for security?
HTML encoding prevents XSS (Cross-Site Scripting) attacks by ensuring user input is displayed as text, not executed as code. Always encode user-generated content before displaying it on web pages.
What characters should be HTML encoded?
Always encode: < > & " ' (quotes). Also encode special characters like © ® ™ and non-ASCII characters. Use numeric entities (&#..;) for characters not in the HTML entity list.