Free SRI Hash Generator (Subresource Integrity)
Generate a Subresource Integrity hash for any script or stylesheet · paste the content or upload the file · so a compromised CDN can't tamper with it.
100% client-side · nothing you enter is ever sent to a server or stored.
Preview · sign in with a free account to run it
How to use it
- Paste the exact contents of the script or stylesheet, or upload the file.
- Copy the sha384 integrity value (sha256 and sha512 are shown too).
- Add it to the tag with crossorigin="anonymous", and generate it again whenever the file changes.
Example
Input
console.log("hello"); (plus a trailing newline)Result
sha256-+URFENx0A+QQSd6xM/aJKqamPAVZGytZ5O5bI017vZk= sha384-M5mGpKxRozBpvsX+PXs0ssm1NdoBYDPN4gQsyCwq+RTqmuLt5T6LWQKklQd4sArc <script src="https://cdn.example.com/app.js" integrity="sha384-M5mGpKxRozBpvsX+…" crossorigin="anonymous"></script>
How integrity works
- integrity attribute
- The browser hashes the downloaded file and refuses to run it if the hash doesn't match. A compromised CDN can't swap in malicious code.
- crossorigin="anonymous"
- Required for files from another origin, or the browser can't check the integrity value.
- Hash mismatch
- The file changed (a new version, minification, or a CDN rewriting it), so the browser blocks it. Hash the exact bytes the CDN serves.
- When SRI doesn't fit
- Scripts that change without notice, such as analytics tags that auto-update, break under SRI. Self-host them, or accept the risk.
Go deeper
Page updated
Frequently asked questions
What is Subresource Integrity?
SRI is a browser feature: you add an integrity="sha384-…" attribute to a <script> or <link> tag, and the browser refuses to run the resource if its hash doesn't match · protecting you if the CDN or third-party host is compromised.
Which hash algorithm should I use?
The generator produces sha256, sha384, and sha512 attributes. sha384 is the common recommendation. Copy the full integrity attribute and add crossorigin="anonymous" to the tag.
Does SimplyScan check whether my third-party scripts use SRI?
Yes. The Security Headers Checker includes a third-party script integrity check, and the full scan covers it too.
Want the full picture?
This tool covers one narrow check. A full SimplyScan runs 60 checks across 14 categories · exposed keys, RLS, XSS, auth, and speed · in 30 seconds.
Run a full security scanRelated tools
AES Encrypt / Decrypt
Encrypt text with a password using AES-256-GCM · and decrypt it back. Keys are derived with PBKDF2 and everything stays in your browser.
.gitignore Generator
Pick your stack and get a ready .gitignore · with the .env and secret-file rules that keep credentials out of your repository.
Data URI Generator
Convert a file or image into a Base64 data URI · ready to inline into HTML, CSS, or JSON. The file is read locally and never uploaded.