CSP Builder

Build a Content-Security-Policy header from per-directive sources.

Support
Works Offline
Privacy First
No Login
No API

Directives

Leave a field blank to omit that directive.

Generated policy

As an HTML meta tag

Prefer sending CSP as the Content-Security-Policy HTTP response header over the meta tag — some directives (e.g. frame-ancestors) don't work in meta tags.

About the CSP Builder

Configure Content-Security-Policy directives like script-src, style-src, and img-src, and get a ready-to-use header value or HTML meta tag. Warnings flag risky choices like 'unsafe-inline' or wildcard sources.

Examples

Basic self-only policy

default-src 'self'

Output

default-src 'self'; script-src 'self'

Keyboard shortcuts

  • Copy the main outputCtrl / ⌘ + Shift + C
  • Download the resultCtrl / ⌘ + S
  • Share this toolCtrl / ⌘ + Shift + S
  • Reset the inputsAlt + R
  • Open the tool search paletteCtrl / ⌘ + K

Related tools

Frequently asked questions

Read more

Version 1.0.0 · Updated 2026-08-06 · Runs entirely in your browser