Add to favorites
Loading tool...

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

  1. 1Upload a JS/CSS file, paste code, or enter a URL
  2. 2Wait for hash calculation
  3. 3Select your preferred algorithm (SHA-384 recommended)
  4. 4Copy the integrity attribute or full script/link tag
  5. 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

Securing third-party scripts from CDNsProtecting against supply chain attacksEnsuring CSS integritySecurity compliance requirementsDetecting compromised resources

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.