About SRI Hash Generator
Generate Subresource Integrity (SRI) hashes for JavaScript and CSS files. SRI allows browsers to verify that resources fetched from CDNs have not been tampered with. Supports SHA-256, SHA-384, and SHA-512 algorithms.
How to Use
- 1Upload a JS/CSS file, paste code, or enter a URL
- 2Wait for hash calculation
- 3Select your preferred algorithm (SHA-384 recommended)
- 4Copy the integrity attribute or full script/link tag
- 5Add to your HTML with crossorigin="anonymous"
Key Features
- SHA-256, SHA-384, and SHA-512 hashes
- File upload with drag and drop
- URL fetching (when CORS allows)
- Direct code pasting
- Ready-to-use script and link tags
- All three hashes displayed
- Client-side calculation
Common Use Cases
Frequently Asked Questions
Which algorithm should I use?
SHA-384 is recommended as the best balance of security and browser support. SHA-256 also works well for most uses.
Why do I need crossorigin="anonymous"?
SRI requires CORS to access the file contents for verification. Without crossorigin, the browser cannot check the hash.
What happens if the hash doesn't match?
The browser will refuse to load the resource, protecting your users from potentially malicious code.
Privacy First
All processing happens directly in your browser. Your files never leave your device and are never uploaded to any server.
You might also like
CSP Builder
Visual Content Security Policy builder. Create CSP headers to protect against XSS and code injection attacks
Password Generator
Generate ultra-secure passwords with presets (Simple to Paranoid), strength analysis, entropy calculation, crack time estimation, password history, and bulk generation
CSR Generator
Generate Certificate Signing Requests (CSR) for SSL/TLS certificates with RSA key pairs. Submit to CAs for certificate issuance