CSP Parser
Parse a Content-Security-Policy value in your browser. Each directive and source is listed, with duplicate, unknown and unsafe sources called out.
What this csp parser does
The policy is split into directives exactly as a browser reads it, and the report names duplicates (where the first wins), unknown directive names (a typo silently disables a rule) and the sources that weaken the policy. It is a reading aid, not a validator: enforcing the policy is still the browser's job.
How to use it
CSP Parser: paste the CSP header value into the box above, and press Run to get the directive table below.
Worked example
Input:
default-src 'self'; script-src 'self' 'unsafe-inline' https://cdn.example.com; img-src *
Output:
Directive Values
default-src 'self'
script-src 'self', 'unsafe-inline', https://cdn.example.com
img-src *
Notes
- 'unsafe-inline' allows inline scripts or styles and weakens the policy.
- The * source allows any origin in that directive.
Why it runs in your browser
The conversion happens on this page with JavaScript. Your input is not posted to a server, so it works offline after the page loads and nothing is retained anywhere. The page reads CSP header value and returns directive table; reloading the page discards both.
The policy is split into directives exactly as a browser reads it, and the report names duplicates (where the first wins), unknown directive names (a typo silently disables a rule) and the sources that weaken the policy. It is a reading aid, not a validator: enforcing the policy is still the browser's job.
Parse a Content-Security-Policy value in your browser. Each directive and source is listed, with duplicate, unknown and unsafe sources called out.
How to use it
CSP Parser: paste the CSP header value into the box above, and press Run to get the directive table below.
Why it runs in your browser
The conversion happens on this page with JavaScript. Your input is not posted to a server, so it works offline after the page loads and nothing is retained anywhere. The page reads CSP header value and returns directive table; reloading the page discards both.
What to Expect
Best for
- Converting CSP header value to directive table when the data is already on screen.
What this tool keeps
- Your input is not posted to a server, so it works offline after the page loads and nothing is retained anywhere.
Sample input
default-src 'self'; script-src 'self' 'unsafe-inline' https://cdn.example.com; img-src *
Sample output
Directive Values default-src 'self' script-src 'self', 'unsafe-inline', https://cdn.example.com img-src * Notes - 'unsafe-inline' allows inline scripts or styles and weakens the policy. - The * source allows any origin in that directive.
Frequently asked questions
How do I use the csp parser?
CSP Parser: paste the CSP header value into the box above, and press Run to get the directive table below.
Is my input uploaded?
No. The text is parsed on this page with JavaScript and is never posted to a server.
Is there a size limit?
Yes: 5 MB per run. Larger input is refused with a message rather than freezing the tab.
Build custom tools for your store
Join the SDK program to create useful ecommerce utilities for your store.