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

  1. Enable the CSP directives you need.
  2. Toggle source values for each directive.
  3. Add custom domains as needed.
  4. 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

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.

ToolBird Assistant

Find the right tool instantly

Hey! I'm ToolBird Assistant. Tell me what you need and I'll find the right tool for you.