1. Free tools
  2. 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.

Drop a .js or .css file here, or click to choose

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.

  1. 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.

  2. Generate the hash

    The tool computes a SHA-384 digest with the Web Crypto API and base64-encodes it into an integrity value.

  3. 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.

AttributeWhat it does
integrityThe algorithm and base64 hash the browser must match, like sha384-abc...
crossoriginSet to anonymous so the response can be read for the integrity check
multiple hashesYou can list more than one, space separated; the strongest supported one is used

WHAT YOU GET

Everything to ship SRI correctly

THREE WAYS

URL, paste or file

Fetch a CORS-enabled URL, paste the exact content, or drop the file. All three hash the same bytes.

CHOICE

Any SHA level

SHA-256, SHA-384 or SHA-512. SHA-384 is the common default and what most CDNs publish.

READY

Full tag output

Get the complete script or link tag with integrity and crossorigin, detected from the file extension.

EXACT

Web Crypto digest

Hashes come from the browser's SubtleCrypto, the same primitive the browser uses to verify SRI.

HELPFUL

CORS guidance

When a fetch is blocked, the tool tells you why and points you to the paste or drop option.

PRIVATE

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.

TaskThis free toolSiteAuditLint app
Generate an SRI hash for a fileYesNot its job
Find third-party scripts across pagesNoYes
Flag mixed content and insecure requestsNoYes
Audit a whole site at onceNoYes

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