Skip to main content
Bethemesh
Security & privacy

CSP generator

Generate a readable CSP with presets, warnings, and output ready for an HTTP header or meta tag.

Embed this widget

Customize the result, check the live preview, then copy the code.

Preview

Embed code type

Code to copy

Responsive and automatically resized by Bethemesh.

  • 100% local
  • Instant
  • Free
  • No account
  • Works offline
  • Clipboard

Preset

Generates a monitoring header that does not block resources.

Directives

Separate sources with spaces or commas.

HTTP header

Meta tag

Raw policy

Why use this tool?

Build a Content Security Policy to restrict the sources a browser may load. Generation stays local.

100% local and secure

Your data stays on your device and is never sent to our servers.

Smart processing

Generate or verify sensitive data with clear and immediate controls.

Supported formats

Strings, keys, hashes, and technical formats depending on the security function.

Save time

Get a clean, ready-to-use result in seconds without installing software or configuring a complex workflow.

Guide

How to use this tool

  1. 1

    Choose a preset

    Start with a strict, analytics, or permissive policy.

  2. 2

    Adjust directives

    Add only the domains and schemes your site needs.

  3. 3

    Deploy carefully

    Test with Report-Only before blocking resources.

Tips and best practices

  • Start with default-src and specialize other directives.
  • Avoid unsafe-inline, unsafe-eval, and wildcards when possible.
  • A complete CSP must be tested across every page.

Frequently asked questions

What does a CSP do?

It helps reduce risks such as executing scripts or loading resources from unexpected sources.

Header or meta tag?

The HTTP header is preferred and supports more directives. A meta tag can help but has limitations.

Why use Report-Only?

It lets you observe violations before enforcing a blocking policy.

Was this tool useful?

Recommended workflow

Continue your processing

Discover tools that naturally fit before, after, or alongside this one.

Complementary tools

Security & privacy

Security headers generator

Generate HTTP security headers for the protections you want to enable on your site.

100% local
Use this tool
Security & privacy

AES Encrypt & Decrypt

Encrypt and decrypt text locally with AES-256-GCM and a password.

100% localNew
Use this tool