Subresource Integrity (SRI) Generator

Hash exact file bytes with SHA-256, SHA-384 or SHA-512 and generate integrity attributes for scripts and stylesheets.

Drop one file, up to 64 MiB.

Hash the file that will be served

Select one file up to 64 MiB. The tool hashes raw bytes without decoding text or changing line endings. SHA-256, SHA-384 and SHA-512 output uses the SRI algorithm-base64 format; All three returns space-separated tokens. Editing or rebuilding the file changes its digest.

The resource URL is used only to construct a script or stylesheet tag and is never fetched. The tool HTML-escapes the URL and adds crossorigin=anonymous. Use the actual deployed resource URL; a local filename or a URL alone cannot prove the remote content matches the selected file.

Browser enforcement and CORS

The browser compares the received bytes with the integrity metadata before using a supported resource. A cross-origin resource must also satisfy CORS. If multiple supported algorithms are present, the strongest available algorithm governs; one matching weaker token does not rescue an incorrect stronger token.

SRI protects a resource reference, not its publisher’s identity or the behavior of code that already matches. Keep the HTML containing the integrity attribute trustworthy, update its value when you intentionally update the resource, and verify the result in a real browser.

Reference

Questions & answers

Why does copying text produce a different hash?

Encoding, BOM, line endings and trailing newlines are bytes too. Select the exact final file that the server serves.

Does this download a file from my URL?

No. Only the selected local file is hashed; the URL is used to build output markup.

Is my input uploaded?

No. Processing runs in your browser. Engines load from this site; the tool does not send input to a processing API or save it. Clear removes the visible input and result.

Other Languages