Start a project

Tool 184 of 425 · Security

Subresource Integrity Hash Generator

Hashes a script or stylesheet you paste or open and writes the complete script or link tag with integrity and crossorigin attributes.

Subresource Integrity Hash Generator

Your input

Result

Tag
Integrity value

    01

    What it does

    Hashes a script or stylesheet you paste or open and writes the complete script or link tag with integrity and crossorigin attributes.

    • sha256, sha384 or sha512 with WebCrypto
    • Paste text or open the exact file
    • Script or stylesheet tag
    • CORS and byte-exactness reminders

    02

    Private by design

    Everything happens in your browser. Nothing you type, paste or upload is sent anywhere, and it keeps working offline once the page has loaded.

    03

    What you get

    A tag with integrity, and the bare hash, with a Copy and a Download button on every result.

    • SRI
    • integrity
    • CDN security

    Why it matters

    Subresource Integrity makes the browser refuse a CDN file whose bytes have changed, which protects you if the CDN is compromised. The integrity value must be the base64 hash of the exact bytes the server sends.

    This generator hashes the file on your device and writes the finished tag, so you don't have to pipe openssl through base64 by hand.

    How to use it

    1. Open a file or paste the input the tool asks for.
    2. Press Generate hash. Results also update as you type.
    3. Read the summary line, then the table, notes or output below it.
    4. Copy or download what you need. Nothing leaves this page.

    FAQ

    Why does the browser block my file even with the right hash?

    Usually the server changes the bytes (minifies, adds a BOM, re-encodes line endings) or the CDN doesn't send CORS headers for a cross-origin file.

    Is my input uploaded?

    No. The tool runs in your browser and nothing you type, paste or open is sent anywhere.

    Can I rely on the result?

    It follows the public specification or formula named on this page and says where it simplifies. Check anything critical against the official tool or documentation before you ship it.

    Work with me

    Want a site that gets these right?

    I build fast, accessible websites and web apps that pass these checks from day one. Tell me about your project and I'll reply personally with honest next steps.

    All developer tools · Back to leej.uk