XSS Payload Tester

Try common cross-site scripting payloads against your own inputs to catch unsanitized output before attackers do — for defensive testing only.

Preview an HTML sanitizer transformation

Enter HTML to see how the browser-based DOMPurify HTML profile transforms it. Both panels display text only: this page does not execute the input or preview rendered markup.

Defensive learning aid only—not a website scanner or security verdict. This tool does not test reflected, stored, or DOM XSS in an application.

Processing happens locally in this tool; input is not submitted to a scanning service or saved in browser storage. The shared site may load separate analytics or advertising scripts, so do not enter sensitive content.

HTML input

Limit: 12,000 characters. 0 entered.

How to use this preview

  1. Paste a small HTML sample or load the example.
  2. Compare the original and DOMPurify-transformed strings; neither is rendered as HTML.
  3. Copy the transformed string for further review, then assess it in your own authorized application context.

HTML sanitization is for cases where an application intentionally accepts markup. For plain text, prefer framework-escaped text output. Contextual encoding and correct source-to-sink review remain necessary. See the OWASP XSS Prevention Cheat Sheet and DOMPurify documentation, and the PortSwigger XSS reference.

XSS Sanitizer Tester features

A local, text-only preview of DOMPurify's HTML-profile transformation. It does not test a live website or guarantee application security.

  • Transform HTML locally with the existing DOMPurify HTML profile.
  • Compare original and transformed markup as text, without executing either string.
  • Load a sample, clear input, copy output, and see the character limit.
  • No scanning endpoint, target URL, or browser-storage persistence.

XSS Sanitizer Tester FAQ

Does this test my website for XSS?

No. It locally shows how DOMPurify transforms the HTML you enter. It does not send requests, inspect a website, or test reflected, stored, or DOM-based XSS in an application.

Does sanitized output prove that my application is secure?

No. This preview is not a security verdict. Safe handling depends on the application, the output context, and where data flows. Test only systems you are authorized to assess.

Why does output encoding depend on context?

Text, HTML attributes, URLs, JavaScript, and CSS have different parsing rules. Use encoding appropriate to the exact output context; HTML sanitization is not a substitute for contextual encoding.

Does a Content Security Policy replace sanitization?

No. CSP can add defense in depth, but it does not replace context-appropriate output encoding, safe DOM APIs, or sanitization where markup is intentionally accepted.

Is my input sent to a server?

This tool processes the entered text in your browser and does not submit it to a scanning service or save it in browser storage. The shared site may load separate site-wide analytics or advertising scripts; avoid entering sensitive data.

Infinio Tools
© 2026 Infinio Labs