CSP Header Generator

Build a Content-Security-Policy header or meta tag.

About CSP Header Generator

Create a Content Security Policy (CSP) to reduce XSS risk and control which resources your site can load. Fill in the directives you need and copy the header or meta tag output.

How to use

  1. Pick a starter template or enter directives manually.
  2. Copy the header output or meta tag.
  3. Deploy, then iterate based on browser console reports.

Privacy

No data is sent anywhere. Everything stays in your browser.

For resource integrity and response header checks, see SRI Hash Generator, HTTP Header Checker, and SSL Checker.

Related Tools

More tools you may find useful.

Recent Blog Posts