HTML Escape / Unescape

0 Chars
0 Chars
About HTML Escape / Unescape

HTML Escaping converts HTML special characters into their corresponding HTML entities to prevent the browser from interpreting them as tags or scripts. It is commonly used to display user input safely and prevent XSS attacks.

  • πŸ” Common escape characters:
    • & β†’ &
    • < β†’ &lt;
    • > β†’ &gt;
    • " β†’ &quot;
    • " β†’ &#39;
  • πŸ”„ Unescaping reverses the process, restoring HTML entities back to their original characters.
  • πŸ’‘ Example: Input <script>alert("XSS")</script> becomes &lt;script&gt;alert(&#39;XSS&#39;)&lt;/script&gt; after escaping, allowing it to be safely displayed on a page.