SRI Hash Generator

Paste the contents of a script or stylesheet, or load the file, and get its subresource integrity hash plus a ready-to-paste tag. Everything is hashed locally. It runs in your browser.

When you load a script or stylesheet from a CDN, subresource integrity lets the browser verify the file hasn’t been tampered with, and this SRI hash generator produces the hash you need. Paste the exact contents of the resource, or load the file, and this subresource integrity generator computes a SHA-256, SHA-384 or SHA-512 digest with the browser’s own crypto and hands back the integrity="sha384-…" value. It also assembles the full <script> or <link> tag with crossorigin set, so you can copy one line straight into your HTML. As an integrity hash tool it recomputes on every keystroke, and the bytes never leave your machine.

24 B
Resource content
integrity
<script> tag
<link> tag (stylesheets)

The hash must cover the exact bytes the browser downloads. If the CDN re-minifies or changes a single character, the integrity check fails and the browser blocks the file — regenerate the hash whenever the resource changes.

How it works

  1. 1

    Provide the resource

    Paste the exact contents of the file you host, or load it with the file picker. The hash covers those exact bytes.

  2. 2

    Pick a hash algorithm

    Choose SHA-256, SHA-384 (the common default) or SHA-512. The integrity value updates instantly.

  3. 3

    Copy the tag

    Set the resource URL, then copy the ready <script> or <link> snippet with the integrity and crossorigin attributes.

Instant & 100% private — nothing is uploaded

Everything runs locally in your browser. Your code, text and files are processed on your own device and are never sent to a server — so there are no upload waits, no size limits from us, and nothing is ever stored or logged.

Frequently asked questions

What is subresource integrity?
It’s a browser feature that checks a downloaded script or stylesheet against a hash you put in the tag. If the file’s bytes don’t match, the browser refuses to run it — so a compromised CDN can’t quietly swap in malicious code.
Which hash algorithm should I use?
SHA-384 is the usual choice and what most CDNs publish. SHA-256 and SHA-512 are also valid. This sri generator gives you all three so you can match whatever a library’s docs recommend.
Why does my integrity check keep failing?
The hash must cover the exact bytes the browser downloads. A single changed character — a re-minify, a different line ending, a new version — produces a different hash. Regenerate it with this integrity hash tool whenever the file changes.
Do I need the crossorigin attribute?
Yes, for cross-origin resources. Without crossorigin="anonymous" the browser won’t expose the response to the integrity check and the load fails. The generated snippets include it for you.
Is my file uploaded anywhere?
No. The hashing happens in your browser with the Web Crypto API, so the file contents stay on your device and nothing is sent to a server.