CSP Header Analyzer | Parse Content-Security-Policy Headers

SecurityRuns in Your Browser (No Uploads)

Analyze Content-Security-Policy headers into directives, source expressions, and conservative security review hints without sending data to a server.

Loading…

What to do next

Continue with a related workflow or open the next tool that usually follows this task.

How to Use This Tool

  1. 1

    Paste a Content-Security-Policy header value or full header line.

  2. 2

    Review the directive and source expression counts.

  3. 3

    Check structured findings for risky source expressions and duplicate directives.

  4. 4

    Copy or download the normalized policy for deployment notes.

  5. 5

    Use the findings as review hints, not as a complete security audit.

When to Use This Tool

Deployment Review

Inspect CSP headers copied from browser DevTools before changing a production deployment.

Policy Hardening

Find unsafe-inline, unsafe-eval, wildcard, data:, and HTTP source expressions while tightening script or image policies.

Debugging Notes

Normalize long CSP strings into one directive per line for incident notes and pull request reviews.

Report-Only Review

Review report-only CSP headers before promoting them to enforcement mode.

Examples

Review a response CSP header

Input
Content-Security-Policy: default-src 'self'; script-src 'self' https://cdn.example.com; img-src https: data:
Output
Header name: content-security-policy
Directives: 3
Source expressions: 5
Findings: 1
High-risk findings: 0
Warnings: 1

Findings:
- Warning: data: source in img-src

Normalized policy:
default-src 'self';
script-src 'self' https://cdn.example.com;
img-src https: data:;

Find risky CSP source expressions

Input
default-src *; script-src 'unsafe-inline' 'unsafe-eval' http://cdn.example.com
Output
Header name: none
Directives: 2
Source expressions: 4
Findings: 4
High-risk findings: 3
Warnings: 4

Findings:
- High: Wildcard source in default-src
- High: unsafe-inline in script-src
- High: unsafe-eval in script-src
- Warning: HTTP source in script-src

How CSP Header Analysis Works

The parser strips a Content-Security-Policy or Content-Security-Policy-Report-Only prefix when present.

Policy directives are split on semicolons and normalized to lowercase directive names.

Source expressions are preserved so copied hostnames and tokens remain visible.

Duplicate directives and empty directive segments are reported as findings instead of crashing.

Risk hints are conservative checks for common source expressions such as unsafe-inline, unsafe-eval, wildcard, data:, and HTTP sources.

Frequently Asked Questions

Q.Does this certify that my CSP is secure?

A. No. The analyzer reports conservative review hints. It does not prove that a policy is secure or complete.

Q.Can it scan a live website?

A. No. Paste the header value or full header line manually. The tool runs locally in your browser and does not fetch URLs.

Q.Which CSP issues are detected?

A. It highlights common issues such as missing default-src, unsafe-inline, unsafe-eval, wildcard sources, data: sources, HTTP sources, and duplicate directives.

Related workflow guides

Use these focused guides when you need a practical workflow before opening the tool.

Related Tools

Explore more developer tools

Browse All Tools