SRI Hash Generator
Generate Subresource Integrity hashes
SRI Options
Results
About SRI Hash Generator
Generate Subresource Integrity (SRI) hashes for script and link tags. Verify that CDN-hosted resources have not been tampered with.
How It Works
Computes a cryptographic hash (SHA-256, SHA-384, or SHA-512) of your resource content using the Web Crypto API. Generates the full integrity attribute value and complete HTML tags with crossorigin attribute.
Step by Step
- 1 Paste the content of your JS or CSS file
- 2 Select the hash algorithm (SHA-384 recommended)
- 3 Choose output format: integrity attribute or full HTML tag
- 4 Click Generate to compute the SRI hash
- 5 Add the integrity attribute to your HTML tags
Tips
- SHA-384 is recommended by the W3C SRI specification
- Always include crossorigin='anonymous' with SRI
- Regenerate the hash whenever the resource content changes
- SRI only works with resources served over CORS-enabled connections