Content Security Policy Generator
Create a basic CSP response header with explicit source lists for scripts, styles, and images.
Runs on your device. Nothing you add is uploaded.
Report-only header
HTTP header
Content-Security-Policy: default-src 'self'; script-src 'self'; style-src 'self'; img-src 'self' data:; connect-src 'self'; object-src 'none'; base-uri 'self'; frame-ancestors 'none'
How to use Content Security Policy Generator
- Replace the example with your own page details.
- Review the generated output or preview.
- Copy or download the result you need.
Questions
A report-only header allows you to inspect violations before enforcing the policy. Resources outside the configured sources can produce violations.
The tool processes the values you enter in this browser.
How this works
Builds or reads markup locally with format-specific validation and escaping.
Everything happens in this browser tab. What you type or add stays on your device, and the page has no tracking. Your last settings are kept in this browser so the tool opens the way you left it. Privacy
Related tools
More in Web & SEOMeta Tag GeneratorGenerate a page title, description, canonical link, and Open Graph and Twitter card tags.Open Graph PreviewPaste page HTML to inspect Open Graph and Twitter card metadata without fetching the page.Schema Markup GeneratorGenerate schema.org JSON-LD for an Organization, WebSite, or Article.Robots.txt GeneratorBuild a robots.txt file for a set of allowed and disallowed paths.Telegram Link GeneratorCreate a t.me link to a public Telegram profile, channel, or group.IPv4 Subnet CalculatorCalculate the IPv4 network, broadcast, subnet mask, and usable hosts from an address and prefix.