CSP Header Generator

Generate Content Security Policy headers for web security

Result
HTTP Header
Content-Security-Policy: default-src 'self'
Meta Tag
<meta http-equiv="Content-Security-Policy" content="default-src 'self'">
Nginx Config
add_header Content-Security-Policy "default-src 'self'" always;
Directives
1 directives

About This Tool

The CSP Header Generator creates Content Security Policy headers for web security purposes. It's useful for developers and IT professionals looking to enhance their website's protection against XSS attacks.

Specify the directives you want to include in your policy, such as script-src or img-src, along with the sources allowed. The tool generates a complete CSP header that can be added to your site’s HTTP response headers.

This browser-based utility is perfect for quick testing and development without requiring any sign-up or data submission.

Frequently Asked Questions