CSP Analyzer
Build and validate secure CSP headers.
Loading workspace...
About the CSP Analyzer
Use it to build and test a Content Security Policy header that blocks cross-site scripting without breaking your site's scripts, fonts and images.
Only the URL or domain you enter is checked by our server. Nothing else is collected or stored.
How to use it
- Enter a URL to read its current policy, or start a new one.
- Add the sources your site really uses for each directive.
- Deploy in Report-Only mode first, then enforce.
Frequently asked questions
What does a Content Security Policy do?
It tells the browser which sources may load scripts, styles, images and frames, so injected code from anywhere else is blocked.
Why is 'unsafe-inline' a problem?
It allows any inline script to run, which defeats much of CSP's protection against XSS. Use nonces or hashes instead.
How do I test a CSP without breaking my site?
Send it as Content-Security-Policy-Report-Only first. The browser reports violations but blocks nothing.
Related Tools
Specialized workflows in Website & Performance