SRI Hash Generator
Generate Subresource Integrity hashes (SHA-256/384/512) for scripts and stylesheets using WebCrypto.
File Content
Hash Algorithms
Resource Type
About SRI
Subresource Integrity (SRI) lets browsers verify that fetched resources have not been tampered with. The browser checks the hash of the downloaded file against the expected hash in the integrity attribute and rejects it if they don't match.
SHA-384 is the most commonly used algorithm for SRI. You can specify multiple algorithms separated by spaces for fallback.
Was this page helpful?
Related tools
About SRI Hash Generator
Generate Subresource Integrity (SRI) hashes for external scripts and stylesheets so browsers can verify the file has not been altered. Paste the resulting integrity attribute into your script or link tag.
How to use
- Provide the file contents or URL of the asset.
- Choose the hash algorithm (sha384 is recommended).
- Copy the integrity attribute into your <script> or <link> tag, with crossorigin="anonymous".
Frequently asked questions
- Why use SRI?
- If a CDN is compromised or a file changes, the browser refuses to load a resource whose hash no longer matches, protecting your users.
- Which algorithm is best?
- sha384 is the common recommendation; you can supply multiple integrity values for fallback.