HTML Entity Encoder / Decoder

Convert special characters (like <, >, &) to HTML entities to prevent XSS script executions, or decode them back.

How It Works

  1. Paste your markup or text in the editor.
  2. Special characters (&, <, >, ", ') are converted into their corresponding HTML named entities (&amp;, &lt;, &gt;, &quot;, &#39;).
  3. In decode mode, HTML entities are converted back into raw markup.

Primary Use Cases

Common Security Pitfalls

Frequently Asked Questions

How does HTML entity encoding prevent Cross-Site Scripting (XSS)?
By converting executable tags like <script> into literal text &lt;script&gt;, the browser displays the characters without executing them as code.
Is HTML entity encoding sufficient for all parts of a webpage?
No. Encoding requirements change depending on context: HTML body, attributes, JavaScript variables, CSS, and URLs each require specialized escaping.

References & Standards