CSP Generator
Build Content Security Policy headers visually. Toggle directives, select sources, and copy the complete header string. 100% client-side.
Directive Selection
Fallback for other directives
JavaScript sources
CSS stylesheet sources
Image sources
Font file sources
Fetch, XHR, WebSocket
Audio and video
Plugins (Flash, etc.)
Iframe sources
Web Workers
Web manifest
Restrict base element
Form submission targets
Who can embed this page
Upgrade HTTP to HTTPS
Block mixed HTTP/HTTPS
default-src 'self'<meta http-equiv="Content-Security-Policy" content="default-src 'self'" />Secure Headers
Content Security Policy (CSP) helps prevent Cross-Site Scripting (XSS), clickjacking, and other code injection attacks by restricting sources of executable content.
Flexible Directives
Easily configure scripts, styles, images, and frames. Add custom domains, use nonces, or enforce strict policies with a simple visual interface.