Tool
What the SRI Hash Generator does
SRI Hash Generator: subresource Integrity is the Base64 of the file's SHA-384 (or 256/512) digest, prefixed with the algorithm name. Everything runs in your browser and the file is never uploaded.
Pick a file and the SRI Hash Generator generates it right here in the page. Everything runs on your own device, which means no waiting and no copy left on a server.
Typical users are someone verifying a download. Reusing a password is still the single most common way accounts fall over.
This runs client-side, which means we never receive what you enter and could not retrieve it if asked.
Everything needed to verify a result is further down: the fields, the method and one fully worked example.
What do the SRI Hash Generator fields mean?
The SRI Hash Generator uses 4 inputs. Nothing is blank on load, so you can see the shape of the answer before supplying your own figures.
| Field | What to enter | Default |
|---|---|---|
| Exact file contents (paste the script or stylesheet) | paste or type any amount of text | console.log("hello"); |
| Or choose the file | stays on your device | none |
| URL the tag will load (optional) | optional | https://cdn.example.com/lib.min.js |
| Algorithm | choose from sha384 (recommended), sha256 or sha512 | sha384 (recommended) |
How does the SRI Hash Generator work?
Each output is derived from the inputs above in a single pass; there is no hidden state carried between runs, so the same inputs always give the same generated output.
Bad input produces a message, not a silently incorrect figure.
What a typical run looks like
You provide: Exact file contents (paste the script or stylesheet), Or choose the file, URL the tag will load (optional) and Algorithm
What happens: the file is read into memory by your browser, processed locally, and offered back as a download. It is never uploaded.
You get back: the output file, and a status line reporting what the tool read and wrote.
A fast machine finishes sooner than a slow one, and the only ceiling on file size is the memory available to the page.
Read next: How Hashing Works: MD5, SHA-1, SHA-256 and Why Two Are Broken
How to use it
- Paste your content into Exact file contents (paste the script or stylesheet).
- Choose your file under Or choose the file, or drag it onto the drop area.
- Type URL the tag will load (optional).
- Pick a value for Algorithm: the options are sha384 (recommended), sha256 or sha512.
- Press Generate Integrity Hash.
- Read integrity and HTML tag in the results panel.
- Print gives a tidy version without the navigation, which is handy for attaching to a file.
What this tool does not do
- Randomness comes from your browser's cryptographic random source, which is suitable for passwords and keys.
- Anything generated here is only as safe as where you store it afterwards.
- No allowance is made for local rules, regional variations or house conventions.
- Performance scales with your own hardware, since no server does the work.
Frequently asked questions
The form asks for Exact file contents (paste the script or stylesheet), Or choose the file, URL the tag will load (optional) and Algorithm. Nothing starts empty, so nothing is mandatory before you see a result.
No. The file is read by your browser and processed inside the page. It is never sent to us, which is also why it keeps working offline once loaded.
No payment and no login. Advertising covers the running costs.
As accurate as the inputs allow. The arithmetic itself introduces no error beyond display rounding.