SRI Hash Generator

Paste JavaScript, CSS, or another static asset body to generate SHA-256, SHA-384, and SHA-512 Subresource Integrity values plus ready-to-copy script and stylesheet markup.

How to use these SRI hashes

Use the integrity value that matches the exact bytes served by your CDN. SHA-384 is commonly used in examples and is highlighted as the default recommendation. If the hosted asset changes, regenerate and update the integrity attribute.

About this tool

SRI Hash helps developers, release engineers, and security reviewers generate Subresource Integrity hashes from the exact asset content they plan to serve. Use it for CDN script tags, stylesheet links, supply-chain checks, deployment notes, and copyable SHA-256, SHA-384, or SHA-512 integrity attributes.

Use cases

  • Paste the production JavaScript or CSS bytes from a build artifact to create matching integrity attributes before publishing a CDN snippet.
  • Copy example script and link markup into documentation, pull requests, release notes, or security review checklists.
  • Compare SHA-256, SHA-384, and SHA-512 SRI outputs when a policy, framework, or third-party integration asks for a specific hash strength.

FAQ

What is SRI Hash best used for?

SRI Hash is best used to generate Subresource Integrity attributes from exact asset content for script and stylesheet tags that load resources from a CDN or another origin.

Which SRI algorithm should I choose?

SHA-384 is commonly used in SRI examples and is highlighted by this tool, but SHA-256 and SHA-512 values are also provided when your policy or platform requires them.

Why did my browser reject an asset after adding integrity?

The integrity value must match the exact bytes served by the asset URL. Regenerate the hash after minification, compression-independent content changes, CDN rewrites, or any deployment that changes the file body.