Subresource Integrity (SRI) Generator

Paste the file exactly as it is served — SRI hashes the bytes, so even a differing trailing newline changes the digest and the browser will refuse the resource.

205 bytes hashed

Subresource Integrity (SRI) Generator — Free Online Tool

Generates the integrity attribute for a script or stylesheet by hashing its exact bytes with SHA-256, SHA-384 or SHA-512 and base64-encoding the digest into the sha384-… form the SRI specification requires, emitting a ready-to-paste tag with crossorigin="anonymous", so a CDN that silently changes a file is blocked by the browser.

How to use the Subresource Integrity (SRI) Generator

  • Open the tool above — it runs entirely in your browser, so your input never leaves this page.
  • Paste or type your input into the field, then press the relevant button (e.g. Encode / Decode, Generate, or Convert).
  • Copy the result from the output area with the copy button orCtrl/Cmd + C.
  • No signup, no upload, and no tracking — repeat as often as you need.

Frequently asked questions

Why does my integrity hash not match the file on the CDN?

SRI hashes the exact bytes the browser receives, so a differing trailing newline, CRLF line endings, or a minified-versus-unminified copy all produce a different digest. Fetch the file from the real URL and hash that, not a local copy.

Do I need crossorigin="anonymous"?

Yes, for a cross-origin resource. Without it the response is opaque, the browser cannot read the bytes to verify them, and it blocks the resource outright. Same-origin resources do not need the attribute.

Which algorithm should I use?

SHA-384 is the usual choice and what most CDNs publish. SHA-256 is equally acceptable; SHA-512 is longer with no practical gain. You may list several space-separated hashes and the browser uses the strongest it supports.

Free & private — why use this Subresource Integrity (SRI) Generator

The Subresource Integrity (SRI) Generator runs 100% client-side in your browser. Your data is never uploaded to a server, no account is required, and the tool is completely free. It works offline once the page has loaded and is part of a growing collection of privacy-first developer utilities.

More hashing & crypto tools