SRI Hash Generator — SHA-256/384/512 Integrity for CDN Scripts and CSS
Compute SHA-256/384/512 Subresource Integrity hashes of code or an uploaded file with Web Crypto, with ready <script> and <link> tags.
Hashed: 94 bytes (UTF-8, LF line endings, no BOM). If the server file uses CRLF or a BOM, upload the file.
sha384 is the common choice. When several algorithms are listed, browsers use only the strongest.
Check an existing integrity value
When to use the Subresource Integrity (SRI SHA-256/384/512) Generator
Real Web Crypto hashes
SHA-256, SHA-384 and SHA-512 are computed with crypto.subtle.digest over the exact bytes and written in the sha384-… format of the W3C spec — identical to openssl dgst.
From code or a file
Paste the code, or upload the actual file so line endings, a BOM and non-ASCII characters are hashed as they are — the most accurate way for compiled files.
Ready-to-paste tags
<script> and <link rel="stylesheet"> tags with integrity and crossorigin="anonymous", chosen automatically from the URL extension.
Check existing values
Paste an integrity attribute from your site to confirm it still matches the file. Like browsers, only the strongest listed algorithm counts.
Frequently asked questions
sha256, sha384 or sha512?
sha384 is the common choice many CDNs use. Listing several is allowed, but browsers use only the strongest algorithm.
Why is crossorigin="anonymous" needed?
For files from another domain, the browser may only read the content to check it when it is requested with CORS. Without this attribute, the integrity check fails and the file is blocked.
Why does the hash of pasted code differ from the server file?
The text box keeps LF line endings with no BOM. If the real file uses CRLF, a BOM or different minification, the bytes are not the same. Upload the real file.
Is SRI useful for files on my own domain?
Its main value is for third-party CDNs. For your own files, hashed file names and a Content-Security-Policy are usually more practical.
Similar tools
- Browser Fingerprint & Entropy Privacy TestAudit exposed Canvas, WebGL, timezone, screen & hardware traits in your browser.
- Live localStorage & sessionStorage InspectorInspect keys and byte footprint stored locally on this origin in your browser.
- X.509 SSL/TLS Certificate (PEM) DecoderDecode X.509 certificates (PEM or DER): subject, issuer, SANs, validity and expiry, key type and size, extensions, SHA-256 fingerprint and the chain signature.
- Certificate Signing Request (CSR) DecoderDecode a PKCS#10 CSR: subject, requested SANs, key type and size, signature algorithm, and verify its signature before sending it to a CA.