Skip to content

SRI Hash Generator

Embed

Paste this where you want SRI Hash Generator on your site. Adjust the height to fit.

<iframe src="https://www.browserutils.dev/embed/sri-hash-generator/" width="100%" height="500" frameborder="0" loading="lazy" title="SRI Hash Generator"></iframe>
<p style="font-size:12px;margin:4px 0 0"><a href="https://www.browserutils.dev/tools/sri-hash-generator/">SRI Hash Generator</a> by BrowserUtils</p>

Generate Subresource Integrity hashes for scripts and stylesheets.Runs in this tab.

Next step

About SRI Hash Generator

Free online SRI hash generator. Create Subresource Integrity hashes (SHA-256, SHA-384, SHA-512) for script and stylesheet tags to protect against CDN tampering. It runs in your browser. Nothing is sent to a server.

Questions

What is Subresource Integrity (SRI)?
SRI is a security feature that allows browsers to verify that files fetched from CDNs or third-party servers have not been tampered with. You include a cryptographic hash in the integrity attribute of script or link tags, and the browser checks the downloaded file against that hash before executing it.
Which SRI hash algorithm should I use?
SHA-384 is the most commonly used and provides a good balance of security and compatibility. SHA-256 is also widely supported. SHA-512 offers the highest security but is less commonly seen. You can include multiple hashes for fallback compatibility.
How do I add an SRI hash to a script tag?
Add the integrity attribute to your script or link tag, like <script src="..." integrity="sha384-..." crossorigin="anonymous">. The crossorigin attribute is required for SRI to work with resources served from a different origin.
What happens if the SRI hash does not match the file?
The browser blocks the resource from loading entirely. This protects your users from executing tampered code, but it also means your page may break if the CDN serves an updated file. Always update your SRI hashes when you update the library version.
Does the SRI hash generator process my file locally?
Yes. The hash is computed entirely in your browser using the Web Crypto API. The file contents are never sent to any server.

More in Security & Privacy

All 10 security & privacy