CSP Header Generator
Visually build a Content-Security-Policy HTTP header. Enable directives like script-src, style-src, and img-src with checkboxes. Copy the generated header string.
- 100% free
- No signup
- Runs in your browser
Used 13.6K times today
default-srcFallback for all resource typesscript-srcJavaScript sourcesstyle-srcCSS sourcesimg-srcImage sourcesfont-srcFont sourcesconnect-srcAJAX, WebSocket sourcesmedia-srcAudio and video sourcesobject-srcPlugin sources (Flash, etc.)frame-srciframe sourcesworker-srcWeb Worker sourcesform-actionForm submission targetsupgrade-insecure-requestsUpgrade HTTP to HTTPSContent-Security-Policy: default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:How to Use CSP Header Generator
- 1
Enable directives
Check the directives you want to include such as default-src, script-src, and style-src.
- 2
Set source values
Enter allowed sources for each directive, such as self, https:, or specific domains.
- 3
Copy the header
Copy the generated Content-Security-Policy header string for your web server configuration.
Frequently Asked Questions
What is a Content Security Policy?
Should I start with strict-dynamic?
Embed This Tool
Add this tool to your website for free. Just copy and paste the code below:
<iframe src="https://utilko.com/embed/csp-header-generator/" width="100%" height="500" frameborder="0" title="CSP Header Generator"></iframe> About CSP Header Generator
The CSP Header Generator on Utilko provides a visual builder for Content-Security-Policy headers — one of the most effective HTTP security measures to prevent cross-site scripting attacks.
More Privacy & Security Tools
What Is My IP
Instantly find your public IP address, location, ISP, and network details. Detect IPv4 and IPv6 with one click — no software required.
Password Strength Checker
Test the strength of any password instantly. Get a score, entropy estimate, crack-time estimate, and actionable tips to make your password stronger.
Email Validator
Validate any email address format instantly. Check syntax, domain structure, and common typo patterns without sending a test email.
DNS Lookup
Perform a live DNS lookup for any domain. Query A, AAAA, MX, CNAME, TXT, NS, and SOA records to troubleshoot DNS propagation and email issues.
WHOIS Lookup
Look up WHOIS data for any domain to find the registrar, registration date, expiry date, name servers, and registrant contact information.
SSL Checker
Check the SSL/TLS certificate of any website. Verify validity, expiry date, issuer, cipher suite, and certificate chain to ensure your site is secure.
HTTP Header Checker
Fetch and inspect the HTTP response headers of any URL. Check status codes, security headers, caching directives, and server information instantly.
User Agent Finder
Instantly detect and display your browser's user agent string. Parse it to identify your browser name, version, OS, device type, and rendering engine.