Skip to main content
1

Subresource Integrity Generator

Generate Subresource Integrity (SRI) hashes for JavaScript and CSS files. Protect your site from compromised CDN resources.

SRI Hash Generator
HTML Tag with Integrity

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
Was this tool helpful?
Send output to:
Advertisement

How to use SRI Hash Generator

  1. Enter the URL of your script or stylesheet.
  2. Select the hash algorithm (SHA-256, SHA-384, SHA-512).
  3. Click Generate to create the SRI hash.
  4. 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.

Advertisement

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

Advertisement