Skip to main content
CompressNConvert

File Hash & SRI Generator

Calculate a local file hash and generate a Subresource Integrity value without uploading the file.

Runs locally in your browser

Integrity is not a malware verdict. A matching hash only confirms that the bytes match a reference value. It does not inspect or execute the file.

Local files only · maximum 64 MiB · no URL fetching

Complete tool guide

File Hash & SRI Generator guide

The File Hash & SRI Generator calculates a SHA digest for a local asset and formats the Base64 digest for a script or stylesheet integrity attribute.

The selected file is read in this browser tab and is never uploaded or fetched from a remote URL.

Why use this tool?

  • Verify a downloaded file against a published checksum.
  • Create a browser-compatible Subresource Integrity value for a static asset.
  • Copy hexadecimal, Base64, or integrity-attribute output from one calculation.

Common use cases

  • Generating SRI for a JavaScript or CSS asset
  • Checking a documented SHA checksum
  • Creating deterministic build or release notes

How to use it

  1. 1

    Choose SHA-256, SHA-384, or SHA-512.

  2. 2

    Select the exact local file to hash.

  3. 3

    Wait for browser-based hashing to finish.

  4. 4

    Copy the required digest or integrity attribute.

Subresource Integrity

SRI lets a browser verify that a fetched script or stylesheet matches an expected cryptographic digest before using it.

CORS behavior

Cross-origin SRI also depends on the resource server permitting the request. Add crossorigin attributes only when the hosting setup requires them.

Exact bytes

Any change to the file, including whitespace or line endings, creates a different digest.

Browser memory limit

Files are limited to 64 MiB because Web Crypto hashes the complete file in memory. The page does not start overlapping hash jobs.

Practical tips for better results

  • SHA-384 is a common SRI choice.
  • Recalculate the integrity value whenever the asset changes.
  • Compare checksums from an authenticated source when verifying downloads.

Frequently asked questions

Is the selected file uploaded?

No. The browser reads and hashes the local file directly in this tab.

Does matching a checksum prove a file is safe?

No. A match proves byte-for-byte integrity against that checksum, not that the file or checksum source is trustworthy.

Keep working

Continue with another focused tool from the same collection.