ToolNextToolNext

CSP Header Generator

Build Content-Security-Policy headers visually

'self' ×
'self' ×'unsafe-inline' ×
'self' ×'unsafe-inline' ×
'self' ×data: ×https: ×
'self' ×https://fonts.gstatic.com ×
'self' ×
Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; font-src 'self' https://fonts.gstatic.com; connect-src 'self'
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; font-src 'self' https://fonts.gstatic.com; connect-src 'self'">
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; font-src 'self' https://fonts.gstatic.com; connect-src 'self'" always;

About this tool

Online Content-Security-Policy generator — visually configure 14 CSP directives with common values and custom domains. Includes strict, moderate, and permissive presets. Outputs HTTP header, HTML meta tag, and Nginx config formats.

cspcontent security policy安全headersecurityhttpnginx

Frequently Asked Questions

What is CSP Header Generator?
Online Content-Security-Policy generator — visually configure 14 CSP directives with common values and custom domains. Includes strict, moderate, and permissive presets. Outputs HTTP header, HTML meta tag, and Nginx config formats. This tool is part of the Dev Tools collection on ToolNext.
How do I use CSP Header Generator?
Open this tool and paste or type your data into the input area. Click the action button to process your data. Results update in real time as you modify the input.
What programming languages or data formats does CSP Header Generator support?
CSP Header Generator broadly supports popular programming languages and common data formats. Whether you're a frontend or backend developer, you'll find the right processing capabilities here to boost your daily workflow.
What advantages does CSP Header Generator have over local IDE plugins?
CSP Header Generator requires no software or plugin installation — just open your browser and start using it. It's especially handy when you need to quickly process data, validate formats, or work on a device without a development environment.
Is my data safe?
Absolutely. CSP Header Generator processes all data locally in your browser. No data is ever sent to any server. Your data is cleared when you close the page.
Is CSP Header Generator free to use?
Yes, CSP Header Generator is completely free. All tools on ToolNext are provided free of charge — no registration required, no ads, and no hidden fees.