Developer tools

Subresource Integrity (SRI) generator

Generate a Base64 SHA-256, SHA-384 or SHA-512 integrity token and a ready-to-copy script or stylesheet tag from local file bytes or text.

Subresource Integrity (SRI) generator
Esc to restore

Your inputs

One file, up to 10 MB. Read only on this device; never uploaded. Takes precedence over pasted text, including for an empty file.

Up to 2 MB as UTF-8. No trimming or final newline is added. A textarea can normalize line endings; choose the final file when exact bytes matter.

Absolute HTTP or HTTPS URL without credentials, up to 8,000 characters. Ignored for a token. The URL is never visited.

Run the tool when your settings are ready.

Your result

Your result will appear here.

More actions

Your inputs stay in this browser. Nothing is uploaded or saved.

A clear answer. Here’s how.

Computes a SHA-256, SHA-384 or SHA-512 digest using Web Crypto, encodes its raw bytes as standard Base64, and prefixes the lowercase algorithm name and a hyphen. The result is an HTML integrity attribute value, not a hexadecimal checksum. A chosen file is hashed byte for byte, including any BOM or line endings; otherwise pasted text is encoded as UTF-8 without trimming or an added newline. Use the final resource as delivered: minification and other content changes require a new token. Script and stylesheet output escape the supplied absolute HTTP/HTTPS URL for an HTML attribute and include crossorigin="anonymous". Cross-origin resources also need a CORS response from their host. The tool does not fetch the URL or check its CORS configuration. The generated tag is plain text and is never executed. Downloads are text files. SHA-384 is the initial selection; all three choices are supported by the SRI Recommendation.

How this is checked

4 reference checks passed These 4 cases were run when this page was built, on 3 December 2026, and all reproduce within the stated tolerance. The same cases are part of the automated tests that run on every change to Toolmoz. Engine version 1.

See the checks and where each expected answer comes from
  1. Case 1

    Inputs
    The tool’s default inputs
    Expected, and what Toolmoz gave
    text expected sha384-ywB1P0WjXou1oD1pmsZQBycsMqsO3tFjGotgWkP/W+2AhgcroefMI1i67KE0yCWn, Toolmoz sha384-ywB1P0WjXou1oD1pmsZQBycsMqsO3tFjGotgWkP/W+2AhgcroefMI1i67KE0yCWn
    Where the expected answer comes from
    SHA-384 of ASCII abc: FIPS 180-4 example digest cb00753f45a35e8b… converted from raw bytes to Base64; independently reproduced with Node createHash.
    Allowed difference
    exact
  2. Case 2

    Inputs
    Or paste the resource source Hash algorithm sha256
    Expected, and what Toolmoz gave
    text expected sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=, Toolmoz sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=
    Where the expected answer comes from
    SHA-256 of the empty message, e3b0c44298fc1c14…; independently calculated with Node createHash and encoded as Base64.
    Allowed difference
    exact
  3. Case 3

    Inputs
    Or paste the resource source abcHash algorithm sha512
    Expected, and what Toolmoz gave
    text expected sha512-3a81oZNherrMQXNJriBBMRLm+k6JqX6iCp7u5ktV05ohkpkqJ0/BqDa6PCOj/uu9RU1EI2Q86A4qmslPpUyknw==, Toolmoz sha512-3a81oZNherrMQXNJriBBMRLm+k6JqX6iCp7u5ktV05ohkpkqJ0/BqDa6PCOj/uu9RU1EI2Q86A4qmslPpUyknw==
    Where the expected answer comes from
    SHA-512 of ASCII abc: FIPS 180-4 example digest ddaf35a193617aba… converted from raw bytes to Base64; independently reproduced with Node createHash.
    Allowed difference
    exact
  4. Case 4

    Inputs
    Or paste the resource source Hash algorithm sha256Output stylesheetResource URL (for tags) https://example.com/app.css?v=1&theme=dark
    Expected, and what Toolmoz gave
    text expected <link rel="stylesheet" href="https://example.com/app.css?v=1&amp;theme=dark" integrity="sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=" crossorigin="anonymous">, Toolmoz <link rel="stylesheet" href="https://example.com/app.css?v=1&amp;theme=dark" integrity="sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=" crossorigin="anonymous">
    Where the expected answer comes from
    W3C SRI stylesheet markup with the independently calculated empty-message SHA-256 token and HTML attribute escaping for the URL ampersand.
    Allowed difference
    exact

What this shows: the engine reproduces independently worked values for these cases. It does not prove every possible input is right. To test an answer you were given, see how to check a number; to see what is and is not checked across Toolmoz, see the accuracy ledger.