SRI Hash Generator
Hash exact asset bytes and build the integrity attribute value browsers verify
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 SRI integrity hashes
Paste the exact asset body your browser will fetch. SRI fails if the deployed bytes differ.
What It Generates
Subresource Integrity adds a hash token to a script or stylesheet tag so the browser can reject unexpected content. This page generates the integrity string from pasted asset bytes.
Generate the Right Token
- Paste the exact asset content you expect the browser to fetch.
- Click Generate SRI hashes and copy the integrity attribute value into the final tag.
- 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.