CSP Header Generator
Generate Content Security Policy headers with a visual builder. Configure directives, add sources, and copy the header or meta tag. 100% client-side.
29.0Kuses
8.7/10(252)
Fallback for other directives
Valid sources for JavaScript
Valid sources for stylesheets
Valid sources for images
Valid sources for fonts
Valid targets for fetch/XHR/WebSocket
Valid sources for audio/video
Valid sources for iframes
Valid sources for plugins
Restricts URLs for <base>
Valid targets for form submissions
Valid parents that may embed the page
Content-Security-Policy: default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:">
How to Use the CSP Header Generator
- Enable the CSP directives you need.
- Toggle source values for each directive.
- Add custom domains as needed.
- Copy the header or meta tag output.
Features
- Visual directive builder with common presets
- Supports all major CSP directives
- Output as HTTP header or HTML meta tag
- Custom domain/source support
Recommended Products
Ad📖Networking BooksShop →📡WiFi RoutersShop →🔌Ethernet CablesShop →🔧Network SwitchesShop →📏Cable TestersShop →💻Laptop StandsShop →🖱️Wireless MouseShop →🔌USB-C HubShop →👓Blue Light GlassesShop →🖥️Desk PadShop →
Affiliate Disclosure: As an Amazon Associate, ToolBird earns from qualifying purchases. Links above are affiliate links — if you buy through them, we may earn a small commission at no extra cost to you.
Disclaimer: This tool is provided as-is for informational and educational purposes only.