Subresource Integrity Generator
Generate Subresource Integrity (SRI) hashes for JavaScript and CSS files. Protect your site from compromised CDN resources.
Something went wrong
Note: This generates a placeholder hash. For real SRI, fetch the file and compute the hash server-side or use a build tool.
More options
How to use SRI Hash Generator
- Enter the URL of your script or stylesheet.
- Select the hash algorithm (SHA-256, SHA-384, SHA-512).
- Click Generate to create the SRI hash.
- Copy the HTML tag with the integrity attribute.
What is SRI Hash Generator?
Subresource Integrity (SRI) is a security feature that lets browsers verify that resources fetched from CDNs haven't been tampered with. You add an integrity attribute to script or link tags with a hash of the expected file content.
This tool generates SRI hashes (SHA-256, SHA-384, SHA-512) for any URL or file content. It creates the complete integrity attribute value and the HTML tag with crossorigin attribute.
FAQ
- What hash algorithm should I use?
- SHA-384 is recommended as a good balance of security and compatibility. SHA-512 provides the most security.
- Do I need crossorigin?
- Yes — the crossorigin='anonymous' attribute is required for SRI to work with cross-origin resources.
Related tools
People also use
- CSP Generator🔒 Privacy & Security Tools
Free online Content Security Policy generator. Build CSP headers to prevent XSS, clickjacking, and code injection attacks. Copy-ready policy.
- CSRF Token Generator🔒 Privacy & Security Tools
Free online CSRF token generator. Generate cryptographically secure CSRF tokens for form protection. Multiple formats and customization options.
- HTTP Security Headers Checker🔒 Privacy & Security Tools
Free online HTTP security headers checker. Audit your website's security headers including CSP, HSTS, X-Frame-Options, and more.