Test any Content-Security-Policy in seconds
Paste a raw Content-Security-Policy header or check any live URL. The CSP Evaluator parses every directive, flags unsafe-inline, unsafe-eval, wildcard sources and missing directives, and gives you plain-English fixes.
Paste the exact value of your Content-Security-Policy response header. Directive names and sources are validated as you type.
Please paste a CSP policy before evaluating.
We'll fetch the live response headers server-side and check for a Content-Security-Policy header plus other key security headers.
Please enter a valid URL (e.g. https://example.com).
More free testing tools
Keep testing performance, accessibility and APIs with these related SEOWebChecker.com utilities.
Built for developers who ship secure headers
Every check mirrors real browser CSP behaviour — not a generic keyword search.
Directive-by-directive parsing
Every directive — script-src, object-src, base-uri, frame-ancestors and 20+ more — is parsed and evaluated individually.
Real XSS-risk detection
Flags unsafe-inline, unsafe-eval, bare wildcards and permissive schemes that actually let attackers execute script.
Live URL header scan
Enter any URL to fetch real response headers server-side — see if CSP, HSTS, X-Frame-Options and more are actually deployed.
Actionable recommendations
Each finding comes with a plain-English fix and a copy-ready directive snippet you can drop straight into your header.
A–F security grade
A single, weighted grade summarises overall CSP strength so you can track improvement over time.
Sample policies included
Load a realistic "unsafe" or "safe" sample policy in one click to see exactly what good and bad configurations look like.
How the CSP Evaluator works
Three quick steps — no signup, no rate limits.
Paste or fetch
Paste your Content-Security-Policy header value, or switch to URL mode and enter any website address.
We evaluate live
The policy is parsed directive-by-directive in your browser; URL checks fetch real headers via a secure server request.
Get a fix-ready report
Review the A–F grade, severity-ranked findings and copy or download the full report as text.
What Is a Content-Security-Policy and Why Does It Matter?
A Content-Security-Policy (CSP) is an HTTP response header that tells a browser exactly which sources of scripts, styles, images, fonts and other resources a page is allowed to load. Instead of trusting every script that ends up on a page, the browser checks each request against the rules defined in the content-security-policy header and blocks anything that isn't explicitly permitted. This makes CSP one of the most effective browser-native defenses against cross-site scripting (XSS), data injection and clickjacking attacks — problems that traditional input sanitisation alone often fails to catch. A well-tuned CSP header acts as a safety net: even if an attacker manages to inject malicious markup somewhere in your application, a strict policy can stop the resulting script from ever executing.
Despite its value, CSP is notoriously easy to get wrong. A single missing semicolon, an overly broad wildcard, or a forgotten object-src 'none' directive can quietly turn a strong policy into a weak one — and unlike a broken layout, a weak CSP header doesn't announce itself visually. That's exactly the gap a CSP evaluator is built to close. Instead of manually cross-referencing directive documentation every time you ship a header change, this csp tester parses the full policy string, checks each directive against known-unsafe patterns, and reports findings in plain language with a clear severity rating.
How This CSP Tester Works
This csp validator supports two testing modes. In the first, you paste the raw value of your Content-Security-Policy header directly into the textarea and the parser breaks it into individual directives — default-src, script-src, style-src, object-src, base-uri, frame-ancestors and more — checking each source list for unsafe-inline, unsafe-eval, bare wildcards, overly permissive schemes like data: or http:, and directives that fall back to a missing or weak default-src. In the second mode, you enter a live website URL. The tool performs a real server-side request, reads the actual response headers, and reports whether a content-security-policy header is present at all — a surprisingly common gap, since many sites rely only on a meta tag or skip CSP entirely.
Example: Unsafe vs. Safe CSP Header
A typical unsafe policy looks like default-src *; script-src 'unsafe-inline' 'unsafe-eval' *. This allows scripts from any origin, permits inline script execution and eval(), and gives an attacker who finds any injection point a direct path to running arbitrary JavaScript. A safe policy covering the same application might instead read default-src 'self'; script-src 'self'; object-src 'none'; base-uri 'self'; frame-ancestors 'self'; upgrade-insecure-requests. It restricts every resource type to the site's own origin, blocks legacy plugin content entirely, prevents base-tag hijacking, and stops the page from being framed by other origins — all while remaining compatible with most modern web applications.
Common CSP Header Mistakes This Tool Catches
Beyond obvious wildcards, this csp checker looks for subtler configuration issues: directives that allow unsafe-inline without a matching nonce or hash, a missing object-src fallback that leaves legacy plugin content unrestricted, an absent base-uri that permits base-tag injection, and a missing frame-ancestors directive that leaves a page open to clickjacking even when X-Frame-Options is also absent. It also flags deprecated or non-standard directives, and — when checking a live URL — cross-references related headers such as Strict-Transport-Security, X-Content-Type-Options and Referrer-Policy, since a strong CSP is only one layer of a complete security header strategy.
How to Use CSP Evaluation Results
Every finding this tool generates includes a recommendation you can act on immediately: which directive to add, which unsafe token to remove, and why it matters in terms of real attack scenarios rather than abstract policy language. Treat the A–F grade as a starting benchmark, fix the high-severity findings first — these are the ones most directly tied to script execution and injection risk — then work through medium and low severity items as your application's resource requirements allow. Because every CSP is different depending on which third-party scripts, fonts, and embeds an application relies on, no automated csp validator can guarantee a policy is perfect for your exact use case, but it will reliably catch the mistakes that make the biggest difference to your actual exposure.
Frequently asked questions
A CSP evaluator parses every directive in your Content-Security-Policy header — such as script-src, object-src, base-uri and frame-ancestors — and flags risky configurations like unsafe-inline, unsafe-eval, wildcard sources, and missing fallback directives that could allow cross-site scripting or clickjacking.
Paste the site's full URL into the URL tab of this tool. It performs a live server-side request to fetch the response headers, checks whether a Content-Security-Policy header is present, and reports related headers like X-Frame-Options, Strict-Transport-Security and Referrer-Policy.
An unsafe policy typically allows script-src 'self' 'unsafe-inline' 'unsafe-eval' * which permits inline scripts, eval, and any origin to run code. A safer policy restricts each directive explicitly, for example default-src 'self'; script-src 'self'; object-src 'none'; base-uri 'self'; frame-ancestors 'self', avoiding unsafe-inline and wildcards.
Keep your entire stack secure
The CSP Evaluator is one of 15+ free security testers on SEOWebChecker.com. Explore the full toolkit for XSS, CORS, TLS, clickjacking and more.