Generate SHA-256, SHA-384, or SHA-512 Subresource Integrity hashes for CDN-hosted scripts and stylesheets. Output is the complete integrity attribute value ready for your HTML.
Key Features
Supports SHA-256, SHA-384, and SHA-512 cryptographic hashing algorithms
Generates ready-to-paste integrity="..." and crossorigin="anonymous" HTML attributes
Accepts direct text input, pasted CSS/JS files, or CDN URLs
Prevents CDN tampering and malicious script injection vulnerabilities
How to Use
Paste the code or file contents of your CDN asset into the input area.
Select your desired hash algorithm (SHA-384 is W3C recommended).
Click "Generate SRI Hash" to calculate the integrity string.
Copy the complete <script> or <link> HTML tag snippet.
SRI is a web security feature that enables browsers to verify that resources loaded from third-party CDNs have not been altered or compromised by malicious actors.
Which hash algorithm is best for SRI?
W3C guidelines recommend SHA-384 as an optimal balance between collision resistance and performance, though SHA-256 and SHA-512 are also fully supported.
Why must CDN tags include crossorigin="anonymous"?
Cross-origin requests require CORS headers for the browser to read the response bytes and verify the integrity hash; without crossorigin="anonymous", checks may fail.
Privacy notice: when you run this tool, your input is sent over HTTPS to our server, processed in memory and returned. It is not stored or logged. Avoid pasting live secrets such as private keys or passwords.