HTML Entity Encoder / Decoder

Escape or unescape HTML special characters

About HTML Entities

HTML entities let you display characters that would otherwise be interpreted as markup. Encoding user-supplied content before rendering it is the single most effective defence against cross-site scripting (XSS).

Core entities

  • &&
  • <&lt;
  • >&gt;
  • "&quot;
  • '&#39;

Example

Original: <script>alert(1)</script>
Encoded: &lt;script&gt;alert(1)&lt;/script&gt;