Developer
CSP Generator
Generate Content Security Policy headers and meta tags for improved website security.
Tool
Loading tool...
About this Tool
Use this free CSP generator to create Content Security Policy directives for websites and web applications. Reduce XSS risks and control which resources browsers are allowed to load.
Examples
- default-src 'self'
- script-src 'self' https://cdn.example.com
- img-src 'self' data: https:
Frequently Asked Questions
What is a Content Security Policy?
A Content Security Policy defines which resources such as scripts, images and styles may be loaded by a webpage.
Why should I use CSP?
A well-configured CSP helps mitigate cross-site scripting attacks and other browser-based threats.
Can CSP be used with static websites?
Yes. CSP can be delivered through HTTP headers or meta tags on static websites.