SRI Hash Generator (Subresource Integrity)

Generate cryptographic SRI hashes and ready-to-paste script and link tags to protect web applications against CDN tampering.

At a glance

SRI Hash Generator is a free browser tool that generates Subresource Integrity (SRI) hashes and HTML script/link tags online. Full support for recommended SHA-384, high-security SHA-512, and backward-compatible SHA-256 digests. It also validates any existing SRI hash against source code or files to confirm authenticity. Your inputs never leave your device, and there is no sign-up or install.

Universal Switcher:
From:
To:

100% Client-Side SRI Cryptographic Hashing

Hardware-accelerated Web Crypto API. Your proprietary JavaScript code, CSS stylesheets, and CDN files never leave your browser.

W3C SRI Compliant
|
0 chars • 0 bytes
Primary Integrity Hash SHA-384
HTML <script> Tag
HTML <link> Stylesheet
All Digest Algorithms Comparison Base64 Encoded
SHA-384 Standard Recommendation
sha384-...
SHA-512 Maximum Cryptographic Margin
sha512-...
SHA-256 Legacy Compatibility
sha256-...
Verify Against Expected SRI Hash Paste sha384- / sha512- / sha256-

Why Use This SRI Hash Generator?

100% Client-Side Privacy: Code and files are hashed directly in browser memory via Web Crypto with zero server transmission.
W3C SRI Compliant: Full support for recommended SHA-384, high-security SHA-512, and backward-compatible SHA-256 digests.
Instant HTML Tag Generation: Outputs complete <script> and <link> tags pre-configured with integrity and crossorigin attributes.
Integrity Verifier: Validate any existing SRI hash against source code or files to confirm authenticity.

How to Use SRI Hash Generator

1

Paste Code or Upload File

Enter your JavaScript or CSS source code directly into the editor, or drop your script file into the upload zone.

2

Configure Algorithm & URL

Select your hash algorithm (SHA-384 recommended) and optionally provide the CDN asset URL.

3

Copy Integrity Hash or HTML Tag

Copy the generated SRI hash string or the ready-to-paste HTML tag with a single click.

SHA-384 Subresource Integrity Generation

Calculates the Base64-encoded SHA-384 cryptographic digest of the input script code and wraps it in a W3C-compliant HTML script element.

JavaScript Code / URL Input Source
console.log("Hello from secure CDN asset!");
Generated SRI Hash & HTML Script Tag Processed
Integrity: sha384-y7d60eD4H8+905e+vE0wL2gQ5c+w8+07rK9/V04+6aQ=
Tag: <script src="https://cdn.example.com/app.js" integrity="sha384-..." crossorigin="anonymous"></script>

Technical Specifications & Engine Details

Technical specifications and engine details for SRI Hash Generator
Specification Details
Supported Formats JAVASCRIPT, CSS, TEXT, BINARY → HASH, HTML, TEXT
Execution Mode 100% Client-Side In-Browser (client)
Browser Requirements Modern browser with Web Crypto API support.
Performance Constraints Runs 100% client-side via Web Crypto API. Zero code or assets are uploaded to remote servers.
Maintained by Pragyan Pahadi

100% Client-Side Privacy Guarantee

All cryptographic hashing executes client-side using the browser Web Crypto API. No source code or files are ever sent to remote servers.

Frequently Asked Questions

What is Subresource Integrity (SRI)?
Subresource Integrity (SRI) is a W3C security specification that allows browsers to verify that files fetched from external CDNs have not been unexpectedly modified or maliciously tampered with.
Why is SHA-384 recommended over SHA-256 for SRI?
The W3C specification recommends SHA-384 as the sweet spot for performance, collision resistance, and future-proof security on web assets, while SHA-512 offers maximum cryptographic protection.
Why is the crossorigin="anonymous" attribute required?
Browsers require the crossorigin attribute when loading cross-origin assets with SRI to ensure CORS policies allow integrity checking without leaking origin-restricted information.

Methodology

This tool runs entirely in your browser. The example above shows a representative input and the result it produces.

Last updated .