Encrypt Online
Choose theme
Privacy All tools run entirely in your browser.

CSP Hash Generator

Hash exact inline code and copy the final CSP token browsers expect

Safety note: These policy helpers only hash or generate values from content you paste here. They do not fetch remote assets or tell you whether a whole CSP policy is otherwise complete.
Generate a CSP hash tokenHash the exact inline script or style bytes and copy the final quoted CSP token
Paste the exact inline source, including whitespace, because browsers hash the exact bytes.
What It Generates

CSP hashes let you allow one exact inline script or style block without allowing all inline code. This page builds the final quoted token browsers expect in a policy.

Generate the Right Token
  1. Paste the exact inline code and choose the hash algorithm you need.
  2. Click Generate CSP hash and copy the final quoted token, not just the raw digest.
  3. Copy the generated value exactly. Even trailing whitespace differences change the result.
Why Exact Bytes Matter

CSP hashes, nonces, and SRI tokens are byte-exact. If the inline script changed by one character or the copied asset body is not the exact deployed content, browsers will reject the policy or integrity check.