CSP Analyzer (Content-Security-Policy Evaluator)
Paste a Content-Security-Policy and get a graded report — flags unsafe-inline, unsafe-eval, wildcards, and missing object-src, base-uri, and frame-ancestors. Runs in your browser. Free.
Findings
Directives
💡 How to use
- Paste your CSP to get a graded report of weaknesses and missing protections.
- Findings are ranked: high (fix now), medium, low, info, and good.
- Everything is analyzed in your browser — nothing is sent to a server.
Free CSP Analyzer (Content-Security-Policy Evaluator)
Paste a Content-Security-Policy and get an instant security grade with ranked findings. The analyzer flags risky sources like 'unsafe-inline', 'unsafe-eval', and wildcards, and highlights missing protections such as object-src, base-uri, and frame-ancestors. Runs entirely in your browser. Free, no sign-up.
What is a Content Security Policy?
A Content Security Policy (CSP) is an HTTP header that tells the browser which sources of scripts, styles, images, and other resources are allowed to load on your page. A well-configured CSP is one of the strongest defenses against cross-site scripting (XSS) and data-injection attacks, because it stops the browser from running untrusted code even if an attacker manages to inject it. A weak or misconfigured CSP, however, can give a false sense of security.
How to use the CSP analyzer
It is instant:
- Paste your policy — either the raw value or the full Content-Security-Policy header line.
- See an overall grade and security score.
- Read the ranked findings, from high-risk issues to good practices you already follow.
- Review the parsed directive breakdown to confirm the browser reads it the way you expect.
The most common CSP weaknesses
The analyzer checks for the issues that most often undermine a policy:
- 'unsafe-inline' in script-src — lets inline scripts run, the single biggest XSS gap.
- 'unsafe-eval' — enables eval() and similar dynamic code execution.
- Wildcards (*) or bare schemes (https:) — allow scripts or resources from any host.
- Missing object-src 'none' — plugins and embeds can bypass your script rules.
- Missing base-uri — an injected <base> tag can hijack relative URLs.
- Missing frame-ancestors — the page can be framed for clickjacking.
Why nonces and hashes matter
The modern way to allow specific inline scripts safely is with a nonce (a random token added to each allowed script and to the CSP) or a hash of the script's contents. When a nonce or hash is present, browsers ignore 'unsafe-inline', so you get the convenience of inline scripts without the risk. If the analyzer sees nonces or hashes in your script-src, it credits that as a strong practice — and downgrades the severity of any leftover 'unsafe-inline'.
Directives every strong policy should set
Beyond restricting scripts, a robust CSP locks down a few often-forgotten directives. Set object-src 'none' to disable legacy plugins, base-uri 'none' or 'self' to prevent base-tag injection, and frame-ancestors 'none' or 'self' to stop clickjacking (this replaces the old X-Frame-Options header). Adding form-action 'self' keeps forms from submitting to attacker-controlled endpoints, and a report-to or report-uri directive surfaces violations so you can catch problems in the wild.
Pro tip
Roll out CSP gradually: start with Content-Security-Policy-Report-Only so violations are reported but nothing is blocked, review the reports, then switch to enforcing mode once the policy is clean. Aim for default-src 'none' plus explicit allowlists and nonces for scripts. To build a policy from scratch, use our CSP Header Generator, and check your other headers with the Security Headers Checker.
FAQ
Is this CSP analyzer free and private?
How is the security score calculated?
Why is 'unsafe-inline' considered dangerous?
What should object-src, base-uri, and frame-ancestors be set to?
Does a CSP replace X-Frame-Options?
What is the difference between enforce and report-only mode?
How do I build or fix my CSP?
Related tools
Pro tip: pair this tool with Robots.txt Exposure Checker and Cookie Security Checker for a faster SEO workflow.