Subresource Integrity (SRI) Hash Generator
Local ProcessingGenerate W3C Subresource Integrity (SRI) string attributes (sha384-, sha256-, sha512-) for HTML script and link tags.
How It Works & Processing Standards
Generate W3C Subresource Integrity (SRI) string attributes (sha384-, sha256-, sha512-) for HTML script and link tags.
Tool processing runs in your browser. If you create a calculator or conversion share link, its values are included in the URL. See the privacy policy for account, analytics and advertising data.
Current Limits
- Maximum input length: 2,000,000 characters
To let the browser detect a changed CDN script, put the file hash in the integrity attribute. Paste the file contents, choose an algorithm and get the "sha384-Base64" value.
One space or newline changes the hash, so the contents must match the deployed file exactly.
What You Can Do
- sha256, sha384, sha512
- The default is the recommended sha384.
- Ready-to-use format
- "algorithm-Base64", pasted straight into integrity.
How to Use Subresource Integrity (SRI) Hash Generator
- 1Paste file contentsPaste the script or stylesheet exactly.
- 2Choose an algorithmsha384, sha256 or sha512.
- 3Add to the tagUse integrity="…" crossorigin="anonymous".
Examples
Common Use Cases
- Adding integrity to CDN scripts to guard against supply-chain attacks
- Making hash allow-list values for a CSP
Frequently Asked Questions (FAQ)
After adding integrity the script no longer loads.
Either the contents differ from the hash, or the file is cross-origin and lacks crossorigin="anonymous", so the browser blocks it.
