- Free tools
- CSP Analyzer
FREE SECURITY TOOL
Content Security Policy analyzer
Paste a Content Security Policy and see how well it mitigates cross-site scripting. The analyzer flags unsafe-inline, wildcards, missing directives and more, and grades the policy. Runs in your browser.
- XSS mitigation grade
- Per-directive findings
- Nothing uploaded
Your policy
Paste the header value, with or without the Content-Security-Policy name. Analysis runs locally.
Report
Paste a policy and click Analyze to see the report.
HOW IT WORKS
Grade a policy in three steps
A Content Security Policy is only as strong as its weakest directive. The analyzer checks the choices that actually stop cross-site scripting, the way browser security teams review a policy.
Paste the policy
Drop in the full header value. The analyzer splits it into directives and source lists.
Read the findings
Each risky choice is flagged by severity, with the reason and the fix, from unsafe-inline to missing object-src.
Harden and recheck
Apply the suggestions, paste the new policy, and confirm the grade improves before you ship it.
WHAT WEAKENS A POLICY
The choices that let XSS through
CSP mitigates cross-site scripting by controlling where scripts can load from and whether inline code can run. A few common values quietly defeat that protection.
| Value | Why it is risky |
|---|---|
| 'unsafe-inline' | Allows inline scripts and event handlers, the main vector CSP is meant to block |
| 'unsafe-eval' | Permits eval and similar, letting strings become executable code |
| * or https: | A wildcard script source lets an attacker load code from anywhere |
| missing object-src | Plugins and embeds can execute; set object-src 'none' |
| missing base-uri | An injected base tag can redirect relative script URLs; set base-uri 'self' |
WHAT YOU GET
A review, not just a parser
Clear verdict
A letter grade and plain summary of how well the policy resists cross-site scripting.
Per-directive findings
Every risky value flagged by severity, with the reason and the exact fix to apply.
Nonce and hash savvy
Recognizes nonces, hashes and strict-dynamic, so a modern policy is not penalized for them.
Missing directives
Checks for default-src, object-src, base-uri and a fallback, not only what you included.
Parsed view
See the policy broken into directives and sources, so you can spot typos and duplicates.
Nothing uploaded
The policy is analyzed in your browser. No account, no logging, no server round trip.
ONE POLICY VS YOUR WHOLE SITE
Grade one policy here. Audit your site with SiteAuditLint.
This analyzer reviews one header value. The desktop app crawls your pages and reports the technical and front-end signals that affect security and SEO.
| Task | This free tool | SiteAuditLint app |
|---|---|---|
| Grade a CSP for XSS mitigation | Yes | Not its job |
| Find pages missing security headers | No | Yes |
| Flag mixed content and insecure requests | No | Yes |
| Audit a whole site at once | No | Yes |
Complement a strong CSP with the SRI hash generator for CDN files.
FAQ
CSP questions
What is a Content Security Policy?
A Content Security Policy (CSP) is an HTTP response header that tells the browser which sources of script, style, images and other content are allowed. A well-written CSP is one of the strongest defenses against cross-site scripting.
Why is unsafe-inline a problem?
It allows inline script tags and event handlers to run, which is exactly the behavior an attacker needs for cross-site scripting. Replace it with nonces or hashes so only your own inline scripts execute.
What is strict-dynamic?
strict-dynamic lets a trusted, nonce-marked script load further scripts without listing every host. Combined with nonces, it enables a strong policy that does not rely on a host allowlist, and the analyzer treats it as a positive signal.
Do I need object-src and base-uri?
Yes. Set object-src 'none' to block plugins and embeds, and base-uri 'self' so an injected base tag cannot hijack relative URLs. Both are common gaps even in otherwise careful policies.
Does this analyzer send my policy anywhere?
No. The policy is parsed and graded entirely in your browser. Nothing is uploaded, logged or stored, so you can analyze internal policies safely.
Will a strict CSP break my site?
It can if you rely on inline scripts or third-party widgets. Roll it out in report-only mode first, watch the violation reports, then enforce it once the legitimate sources are allowed.
Is this CSP analyzer free?
Yes, free with no signup. It is one of a set of free developer and SEO tools from SiteAuditLint, the desktop site audit app.
Grade one policy here. Check every page with SiteAuditLint.
Security headers are set in server config and are easy to miss on some routes. The free desktop crawler reports them across your whole site.
Download SiteAuditLint