CSP Generator (Basic)

Build a valid Content-Security-Policy string from directive/source lists

How to use CSP Generator (Basic)

  1. Provide directives as JSON (e.g. defaultSrc, scriptSrc, imgSrc).
  2. Use arrays for source lists and booleans for flag directives like upgradeInsecureRequests.
  3. Copy the generated string and use it in your Content-Security-Policy header.

This tool is a generator, not a runtime CSP debugger.

FAQ

Does it remove duplicate values?

Yes, directives and source values are normalized and deduplicated.