HTML Entity Encoder / Decoder

Encode or decode HTML entities instantly. Convert <, >, & to &lt;, &gt;, &amp; and back. Essential for web developers working with HTML, XML, or escaping user input. Free, instant, runs in your browser.

FAQ

HTML entities are special sequences like &lt; and &amp; that represent characters with special meaning in HTML. They prevent browsers from interpreting code as markup.

Always encode user-generated content before rendering it in HTML to prevent XSS attacks. Also use entities when showing HTML/XML code examples on a webpage.

Named entities use readable names like &lt; for < and &amp; for &. Numeric entities use code points: decimal (&#60;) or hex (&#x3C;). Named entities are easier to read, but numeric entities work for any Unicode character.

Always encode user-generated content before rendering it in HTML to prevent XSS (Cross-Site Scripting) attacks. Also encode characters that have special meaning in HTML when showing code examples: <, >, &, ", and ' in attribute values.

Entity encoding protects against XSS in HTML body content, but it's not a complete solution. You also need context-appropriate encoding for JavaScript, CSS, and URL contexts. Use a Content Security Policy (CSP) as an additional layer of defense.

There are over 2,000 named HTML entities covering common symbols (&copy; for ©, &reg; for ®), mathematical symbols (&pi;, &infin;), Greek letters (&alpha;, &Omega;), arrows (&rarr;, &larr;), and typographic characters (&mdash;, &hellip;).

Yes! The decoder handles named entities (&lt;), decimal numeric (&#60;), and hex numeric (&#x3C;) references - all three forms are converted back to the original character.