Omnikit
DevFilesMoneyAll tools
Ctrl K
Dev toolsFile toolsMoney calculatorsAll tools
HomeDeveloper toolsSRI Hash Generator

SRI Hash Generator

dev

Make the integrity hash and script or link tag for a CDN file, or check one

Runs in your browser. Nothing you type is sent anywhere. Checked against sources on 17 Oct 2026.

An SRI hash is the Base64 SHA-256, SHA-384 or SHA-512 digest of a file, written as sha384-... in a script or link tag's integrity attribute. The browser hashes what it downloads and refuses to run it if the value differs. This page builds the value and the tag, and checks an existing one.

Next:
  • CSP Evaluator Check a Content-Security-Policy directive by directive and see how scripts get past it
  • Hash Generator MD5, SHA-1, SHA-256, SHA-384 and SHA-512 of text or files, with checksum compare

How to generate an SRI integrity hash

1

Open the .js or .css file, or paste its exact contents.

2

Enter the URL the page will load it from, so the tag is ready to paste.

3

Pick the algorithms; SHA-384 is the usual choice and is ticked already.

4

Copy the integrity value or the whole <script> or <link> tag.

About SRI Hash Generator

Subresource Integrity lets a page load a script or stylesheet from a CDN and still be sure it is the file you tested. You put the file's hash in the integrity attribute; if the CDN is hacked or serves a different version, the browser blocks the file instead of running it.

How the value is made. The file's exact bytes are hashed with SHA-256, SHA-384 or SHA-512, the digest is written in Base64, and the algorithm name goes in front: sha384- followed by 64 characters. Open the file itself where you can: pasted text is hashed as UTF-8, and Windows line endings or a byte order mark change every character of the result, so the page warns when it sees either.

Which algorithm. SHA-384 is the common choice and what most CDNs publish. You may list several values separated by spaces. The browser then uses only the strongest algorithm present and accepts the file if any value of that algorithm matches, so a correct SHA-256 beside a wrong SHA-512 still blocks.

In the attribute What the browser does
sha384-A sha512-B Checks the file against B only
sha384-A sha384-B Accepts either of two versions
md5-A or nothing valid Loads the file without any check

The tag. A file from another origin must be loaded with crossorigin="anonymous", or the browser blocks it before comparing anything. The tag is written for a classic script, a module, a stylesheet or a preload, with the URL escaped.

Checking. Paste a tag or an integrity list and open the file: you see the algorithm the browser compares, the value it computes, which entry matched, and any entry it ignores. The checks follow the W3C algorithm step by step and were tested against 411 hashes from Python's hashlib and the specification's own example. Nothing you open leaves the browser.

Frequently asked questions

What is an SRI hash?

An SRI hash is the Base64 digest of a file's exact bytes with SHA-256, SHA-384 or SHA-512, prefixed by the algorithm name, such as sha384- and 64 characters. Placed in the integrity attribute of a script or link tag, it makes the browser refuse the file if a single byte differs.

How do I generate an integrity hash for a CDN script?

Download the exact file the CDN serves, open it here and enter its URL. The SHA-384 value and a ready script tag with crossorigin set to anonymous appear at once. Pasting the code also works, but line endings must match the served file exactly, or the hash will differ.

Which SRI algorithm should I use?

SHA-384 is the usual choice and what most CDNs publish; SHA-512 is equally safe and only longer. SHA-256 is still accepted. Browsers ignore MD5 and SHA-1 entirely. Listing several algorithms gains little, because the browser checks only the strongest one present in the attribute.

Why does my integrity hash not match?

The file changed: a new version behind the same URL, a CDN that compresses or rewrites it, different line endings, or a byte order mark. Open the file the browser actually receives and check it here; the page shows the hash it computed beside the value you have, so you can replace it.

Does subresource integrity need the crossorigin attribute?

Yes, for any file on another origin. Without crossorigin the browser cannot read the response under CORS, so it blocks the file outright, even when the hash is right. Use anonymous unless the file needs cookies, and make sure the CDN sends an Access-Control-Allow-Origin header.

What happens when an integrity attribute has several hashes?

The browser keeps only the entries with the strongest algorithm and accepts the file if any one of them matches. A list with sha384 and sha512 is therefore judged by sha512 alone, while two sha384 values let one tag accept two versions of a file during an upgrade.

Sources

  • W3C Subresource Integritysha256/384/512 tokens, parse metadata, strongest algorithm, case-sensitive match, CORS

Last verified 17 October 2026.

Rates and rules change; check the source before you rely on a figure.

Still stuck? Ask about SRI Hash Generator and anybody who knows can answer. No account needed.

Common uses

  • SRI Hash CheckerCheck whether a file still matches its integrity attribute before the browser blocks it

Same job, other tools: Bcrypt Generator – Generate a bcrypt hash for a test user or a config file · HMAC-SHA256 Generator – Compute an HMAC-SHA256 signature in hex and Base64.

On the related tools: JWT Decoder – Paste a token to read its header, payload and expiry.

Related tools

All developer tools
JWT Decoder, Verifier & EncoderDecode any JWT, verify its signature, and sign new tokens, all in your browserPassword GeneratorStrong random passwords and memorable passphrases, generated on your devicePassword Strength CheckerHow long your password would survive an attack, and exactly what makes it weakHMAC GeneratorHMAC-SHA1, SHA-256, SHA-384 and SHA-512 of text or a file, and signature checksBcrypt Hash and VerifyHash a password with bcrypt at cost 4 to 14, or check a password against a hashTOTP Generator and TesterLive authenticator codes from a secret, a QR code for your app, and a code testerCertificate DecoderRead an SSL certificate, CSR or public key: names, dates, key size and fingerprintsIMEI CheckerCheck an IMEI number’s check digit, see its TAC and serial, and look up the phone model
Was this tool helpful?
Omnikit

Small jobs, done in your browser. Free, fast and private. Files are never uploaded.

Files

  • Compress Image
  • Image to PDF
  • Merge PDF
  • Compress PDF
  • PDF to Word
  • Word to PDF

Dev

  • JSON Formatter & Validator
  • Base64 Encode & Decode
  • JWT Decoder, Verifier & Encoder
  • Password Generator
  • UUID Generator
  • Unix Timestamp Converter

Money

  • SIP Calculator
  • EMI Calculator
  • GST Calculator
  • FD Calculator
  • PPF Calculator
  • Lumpsum Calculator
GuidesQuestionsAboutHow we checkLaw library (beta)PrivacyTermsDisclosureContactMore: Exam practice (UGC NET Paper 1)Runs in your browser. Nothing is uploaded. © 2026 Omnikit (theomnikit.com)