SRI Hash Generator
Generate Subresource Integrity (SRI) hashes (SHA-256/384/512) for scripts and stylesheets. Paste content or upload a file.
About the SRI Hash Generator
Generate Subresource Integrity (SRI) hashes for your scripts and stylesheets so browsers can verify third-party files have not been tampered with.
What this tool does
Paste a file's contents, upload the file, or fetch it from a URL, and the tool computes SHA-256, SHA-384, or SHA-512 integrity values plus a ready-to-use script tag. Everything is hashed locally in your browser using the Web Crypto API.
What is Subresource Integrity?
SRI lets you add an integrity attribute to a script or link tag. The browser hashes the downloaded file and refuses to run it if the hash does not match — protecting you if a CDN is compromised or a file is swapped.
- Protects against tampered or hijacked CDN assets.
- Required by many security policies for third-party scripts.
- Works together with the crossorigin attribute.
How to use the output
Add the generated integrity value and crossorigin="anonymous" to your tag. If the file ever changes, regenerate the hash — even a one-byte change produces a completely different value, which is the point.
FAQ
Which hash should I use?
Why did fetching from a URL fail?
Is the file uploaded to your server?
Do I need the crossorigin attribute?
Related tools
Pro tip: pair this tool with Robots.txt Exposure Checker and Cookie Security Checker for a faster SEO workflow.