- Free tools
- SRI Hash Generator
FREE SECURITY TOOL
SRI hash generator
Generate Subresource Integrity hashes for your scripts and stylesheets. Fetch a URL, paste content or drop a file, pick SHA-256, 384 or 512, and get a ready-to-paste tag with the integrity attribute. Runs in your browser.
- SHA-256, 384 and 512
- Copy-paste tag
- Hashed locally
Resource
The file must allow cross-origin reads (CORS). If a fetch is blocked, paste the content or drop the file instead.
Hashing runs in your browser with the Web Crypto API.
Integrity
Fetch, paste or drop a file to generate its integrity hash.
HOW IT WORKS
Protect third-party files in three steps
Subresource Integrity lets the browser verify that a file from a CDN has not been altered. If the delivered bytes do not match your hash, the browser refuses to run the file.
Point to the file
Fetch the exact URL you will reference, or paste or drop the file so the hash matches the delivered bytes byte for byte.
Generate the hash
The tool computes a SHA-384 digest with the Web Crypto API and base64-encodes it into an integrity value.
Paste the tag
Copy the script or link tag, which includes integrity and crossorigin, into your page. The browser enforces it from then on.
WHY SRI MATTERS
A tampered CDN file can run on your site
When you load a script from a third-party CDN, you trust that the file has not been swapped for a malicious one. Subresource Integrity removes that trust: the browser checks the hash on every load and blocks the file if it has changed.
| Attribute | What it does |
|---|---|
| integrity | The algorithm and base64 hash the browser must match, like sha384-abc... |
| crossorigin | Set to anonymous so the response can be read for the integrity check |
| multiple hashes | You can list more than one, space separated; the strongest supported one is used |
WHAT YOU GET
Everything to ship SRI correctly
URL, paste or file
Fetch a CORS-enabled URL, paste the exact content, or drop the file. All three hash the same bytes.
Any SHA level
SHA-256, SHA-384 or SHA-512. SHA-384 is the common default and what most CDNs publish.
Full tag output
Get the complete script or link tag with integrity and crossorigin, detected from the file extension.
Web Crypto digest
Hashes come from the browser's SubtleCrypto, the same primitive the browser uses to verify SRI.
CORS guidance
When a fetch is blocked, the tool tells you why and points you to the paste or drop option.
Nothing uploaded
Files are read and hashed locally. A fetched URL is requested by your browser, not by our server.
ONE FILE VS YOUR WHOLE SITE
Hash one file here. Audit every page with SiteAuditLint.
This tool produces one integrity hash. The desktop app crawls your pages and reports the front-end and technical signals that affect trust and performance.
| Task | This free tool | SiteAuditLint app |
|---|---|---|
| Generate an SRI hash for a file | Yes | Not its job |
| Find third-party scripts across pages | No | Yes |
| Flag mixed content and insecure requests | No | Yes |
| Audit a whole site at once | No | Yes |
See also the CSP analyzer for a Content Security Policy that complements SRI.
FAQ
SRI questions
What is Subresource Integrity?
Subresource Integrity (SRI) is a browser feature that checks a hash of a fetched script or stylesheet before running it. If the delivered file does not match the integrity hash you put in the tag, the browser blocks it, protecting you from a compromised CDN.
Why does my fetch get blocked?
The browser can only read a cross-origin file if the server sends CORS headers. Many files do allow it, but if yours does not, paste the exact content or drop the file instead, which hashes the same bytes locally.
Which hash algorithm should I use?
SHA-384 is the common default and what most CDN snippets publish. SHA-256 and SHA-512 are also valid. Use whichever your build pipeline standardizes on; you can list more than one.
Do I need the crossorigin attribute?
Yes for cross-origin resources. Set crossorigin to anonymous so the browser can read the response to verify the hash. Same-origin files do not strictly need it, but including it is harmless.
What if the file changes?
Any change, even one byte, produces a different hash, so the browser will block the new file. That is the point of SRI. When you intentionally update a CDN version, regenerate the hash and update the tag.
Does SRI work for images or fonts?
SRI applies to script and link (stylesheet) elements. It is not supported on images, fonts or other resource types, so this tool outputs script and link tags.
Is this SRI generator free?
Yes, free with no signup, and the hashing runs entirely in your browser. It is part of a set of free developer and SEO tools from SiteAuditLint.
Hash one file here. Check your whole front end with SiteAuditLint.
Third-party scripts affect security and performance. The free desktop crawler finds them across your site, along with mixed content and other technical issues.
Download SiteAuditLint