Content-Security-Policy (CSP) Header Builder
Assemble a clean Content-Security-Policy HTTP header for scripts, styles, images, fonts, frames, and upgrade-insecure-requests.
Inputs
Compose a clean, strict CSP header tailored to your analytics and image hosts.
Generated csp-header.txt
Ready to copy or download. Runs 100% in your browser.
Content-Security-Policy: default-src 'self'; script-src 'self' https://www.googletagmanager.com https://va.vercel-scripts.com; style-src 'self' 'unsafe-inline'; img-src 'self' https: data: blob:; font-src 'self' data:; connect-src 'self' https://www.google-analytics.com; object-src 'none'; base-uri 'self'; form-action 'self'; frame-ancestors 'none'; upgrade-insecure-requests- Test first with Content-Security-Policy-Report-Only before enforcing.
Common questions
Why start with Content-Security-Policy-Report-Only?
Report-Only logs violations in the browser console without blocking assets while you verify every third-party host.
What does frame-ancestors 'none' do?
It stops other websites from embedding your pages inside hidden iframes for clickjacking attacks.
More generators tools
Content-Security-Policy (CSP) Inspector & Grader
Fetch live Content-Security-Policy headers, parse every directive, and flag risky unsafe-inline or wildcard script rules.
Security Headers Analyzer
Check your website's live HTTP response headers against six core browser security protections and copy ready-to-use config fixes.
HSTS & Preload Readiness Checker
Inspect Strict-Transport-Security headers for max-age >= 1 year, includeSubDomains, and preload eligibility.
FAQPage JSON-LD Schema Generator
Turn question and answer pairs into clean, valid FAQPage JSON-LD ready to paste into any webpage.
Service JSON-LD Schema Generator
Generate Schema.org Service JSON-LD linking your service name, provider brand, cities served, and description.
Organization JSON-LD Schema Generator
Create clean Organization JSON-LD with your logo URL, phone number, and official sameAs social profiles.