Security Tool

CSP Generator

Generate Content-Security-Policy headers.

Fill in the directives you need and click Generate CSP.

Quick Guide

  1. Step 1: Enter allowed sources for each CSP directive you need
  2. Step 2: Optionally enable report-uri to receive violation notifications
  3. Step 3: Click Generate CSP to build the policy header string
  4. Step 4: Copy the output and add it to your server configuration

What is CSP Generator?

CSP Generator creates Content Security Policy headers for your website. See also: security-headers-checker or hsts-checker.

How It Works

To use CSP Generator, first enter allowed sources for each CSP directive you need. Then, optionally enable report-uri to receive violation notifications. After that, click Generate CSP to build the policy header string. The result appears instantly in your browser.

Use Cases

Frequently Asked Questions

What is CSP Generator?

CSP Generator creates Content Security Policy headers for your website. It runs entirely in your browser, with no sign-up and no file uploads.

How do I use CSP Generator?

First, enter allowed sources for each CSP directive you need. Then, optionally enable report-uri to receive violation notifications. Click Generate CSP to build the policy header string.

Is CSP Generator free and private?

Yes - CSP Generator is completely free and requires no account. Everything runs locally in your browser, so your lookups and generated credentials never leave your device.

Related Tools

Security Headers Checker

Check all security headers

HSTS Checker

Check HSTS headers

CORS Checker

Check CORS headers