</>DevTools

&;HTML Entity

Encode/decode HTML entities

HTML Entity Encoder/Decoder Guide

HTML entities safely represent characters with special meanings in HTML (<, >, &, "). Essential for preventing XSS when rendering user input, or displaying raw HTML source on screen.

Common Entities

CharNamedNumericUse
<&lt;&#60;Tag start
>&gt;&#62;Tag end
&&amp;&#38;Entity start
"&quot;&#34;Attribute
'&apos;&#39;Attribute
space&nbsp;&#160;Non-breaking
©&copy;&#169;Copyright
®&reg;&#174;Trademark
&euro;&#8364;Euro

XSS Prevention Best Practices

  • Always encode user input before output
  • Use context-appropriate encoding: HTML, attribute, JS, CSS, URL
  • Prefer textContent over innerHTML when possible
  • Add Content Security Policy (CSP) headers

🔗Related Tools🔄 Text / Data