Skip to main content
Bethemesh
GuideBest practices

Subresource Integrity (SRI): verify external resource integrity

Understand how SRI hashes help detect unexpected changes to static third-party scripts and stylesheets, and where SRI does not apply.

Published 29 August 2026Reading : 1 minBy Bethemesh Team
Beginner

Subresource Integrity lets a page declare the expected cryptographic hash of a static external script or stylesheet. If the downloaded bytes do not match, the browser refuses the resource.

Generate the fingerprint with the SRI hash generator and keep the integrity value synchronized with the exact file version. The crossorigin behavior must also match how the resource is served.

SRI is useful for versioned CDN assets, but it is not a universal third-party security system. Frequently changing resources are awkward to pin, and SRI does not decide whether the code you approved is safe. It verifies integrity of expected bytes, not trustworthiness.

For the broader distinction between hashes and authenticity, continue with hashes and integrity.

Related tools

Security & privacy

SRI hash generator

Generate a Subresource Integrity hash for a file or pasted content.

100% local
Use this tool
Security & privacy

Hash generator

Generate a text hash using several common hashing algorithms.

100% local
Use this tool

Collection

Secure a website

  1. 01Web security: understand the essential protections of a website
  2. 02Content Security Policy (CSP): reduce XSS risks and unwanted loads
  3. 03HTTP security headers: which ones to enable and why
  4. 04Subresource Integrity (SRI): verify external resource integrity
  5. 05JWT: understand structure, signature, expiration and common mistakes
  6. 06Passwords: generation, strength and useful policies
  7. 07Hashes, integrity and fingerprint comparison: what a hash can really prove

Was this article useful?