Skip to content

SRI Hash Generator

Generate SHA-256, SHA-384, and SHA-512 subresource integrity hashes. Get ready-to-use script and link tags with integrity attributes.

FreeNo SignupNo Server UploadsZero Tracking

How to Use SRI Hash Generator

  1. 1

    Choose input method

    Paste file content directly, enter a URL to fetch, or use batch mode for multiple URLs.

  2. 2

    Generate hashes

    Click Generate to compute SHA-256, SHA-384, and SHA-512 integrity hashes using the Web Crypto API.

  3. 3

    Copy tags

    Copy individual hashes or complete <script> and <link> tags with integrity and crossorigin attributes.

Frequently Asked Questions

SRI is a security feature that lets browsers verify that resources from CDNs or third parties haven't been tampered with. The browser checks the file's hash against the integrity attribute before executing it.

SHA-384 is the most commonly used and recommended. SHA-256 is also widely supported. SHA-512 provides the most security but has longer hashes. Most tools and CDNs use SHA-384.

When loading resources from a different origin (like a CDN), the crossorigin='anonymous' attribute is required for the browser to perform the integrity check. Without it, SRI verification will fail.

SRI protects against content modification (supply chain attacks). If a CDN is compromised and serves modified files, the browser will block them. However, it cannot prevent a CDN from refusing to serve the file.

No. All hashing is done client-side using the Web Crypto API. When fetching URLs, the request goes directly from your browser to the target URL.