SRI Hash Generator
Generate integrity= attributes for <script> and <link> tags. Paste file content or drop a file.
Examples
Click to load sample content
JS: console.log("Hello, World!");
CSS: body { font-family: … } (auto-switches to link tag)
Library snippet (longer realistic file)
Or drop a file
Drop a file or click to select
File never leaves your browser
How it works
Subresource Integrity (SRI) allows browsers to verify that fetched resources haven't been tampered with. The browser computes the hash of the loaded resource and compares it to the integrity attribute value. If they differ, the browser refuses to execute or apply the resource.
SHA-256, SHA-384, and SHA-512 are all supported. Use SHA-384 or SHA-512 for new projects. You can include multiple hashes separated by spaces for forward compatibility.
Security note
SRI only works with CORS-enabled resources. The server must return
Access-Control-Allow-Origin: * or your specific origin. SRI does not work with dynamically generated files whose content changes on each request.