CSP Generator

Builds a Content-Security-Policy header value from a comma-separated list of directives, like "default-src 'self', script-src 'self' https://cdn.example.com".

Ad placeholder: Resp_Horizantal_1 (horizontal)
Ad placeholder: Resp_Square_1 (square)

Builds a Content-Security-Policy header value from a comma-separated list of directives, like "default-src 'self', script-src 'self' https://cdn.example.com".

Use cases

  • Assembling a CSP header for a new web application
  • Turning a list of allowed script sources into a valid policy string

Examples

Two directives

default-src 'self', script-src 'self' https://cdn.example.com
{"policy": "default-src 'self'; script-src 'self' https://cdn.example.com;"}

FAQ

Is my data sent to a server?

Yes — the calculation runs on the server for this tool.