Content Security Policy Header Builder

Create strict Content-Security-Policy HTTP headers and meta tags interactively. Fast, free, and fully client-side.

Directives

Generated Output

HTTP Header

Content-Security-Policy: default-src 'self';

HTML Meta Tag

<meta http-equiv="Content-Security-Policy" content="default-src 'self';">

How the Content Security Policy Header Builder Works

This visual tool helps generate Content-Security-Policy headers to stop XSS and data injection attacks. Set up sources for scripts, styles, images, and fonts, then create valid HTTP headers or HTML meta tags.

Usage Example

Create a strict CSP that only permits scripts from the same origin.

Frequently Asked Questions

What's a CSP?

Content Security Policy adds a layer of security to help detect and stop certain attacks, like Cross-Site Scripting (XSS) and data injection.

Browse more

See all security & privacy tools.