Content Security Policy Header Builder

Generate 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

A visual tool to generate Content-Security-Policy headers to mitigate XSS and data injection attacks. Configure sources for scripts, styles, images, and fonts, and generate valid HTTP headers or HTML meta tags.

Usage Example

Generate a strict CSP that only allows scripts from the same origin.

Frequently Asked Questions

What is a CSP?

Content Security Policy is an added layer of security that helps to detect and mitigate certain types of attacks, including Cross-Site Scripting (XSS) and data injection attacks.

Browse more

See all security & privacy tools.