CSP Builder

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

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'

Related tools

Frequently asked questions

Read more

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