How to Verify File Integrity With Checksums on Any Operating System

Use checksums to confirm downloads, backups and file copies are intact: commands for Windows, macOS and Linux, SHA256SUMS files, and what they can't prove.

Updated September 29, 2026 6 min read

Use the free File Checksum CalculatorGet MD5, SHA-1, SHA-256 and SHA-512 hashes of files and verify downloads

You copied a 40 GB archive to an external drive before wiping a laptop. You downloaded an installer over hotel Wi-Fi. You are about to publish a release and want users to be able to confirm they received the exact bytes you built. In all three cases the question is the same: is this file bit-for-bit identical to the original?

A checksum answers that in seconds. This guide shows how to use checksums for downloads, backups and your own releases, gives the exact commands for Windows, macOS and Linux, and explains the limits: when a matching checksum proves something and when it proves nothing.

What a checksum does

A cryptographic hash function reads every byte of a file and produces a short fixed-length fingerprint. Change a single bit anywhere and the fingerprint changes completely. So if you hash two files and the results match, you can treat the files as identical; if they differ, something changed.

Different algorithms produce fingerprints of different lengths, which is also how you can tell them apart:

Algorithm Hex length Use it for
MD5 32 Legacy lists and accidental-corruption checks only
SHA-1 40 Legacy; not safe against deliberate tampering
SHA-256 64 The default choice for integrity checks
SHA-384 96 Occasionally used in signed manifests
SHA-512 128 Common on some Linux distributions and package tools

MD5 and SHA-1 still catch random corruption such as a truncated download or a bad sector, but attackers can create two different files with the same MD5 or SHA-1. If the purpose is security rather than simple error detection, use SHA-256 or stronger. If you only need a quick error check for data in transit, a CRC32 checksum is faster still, but offers no protection against tampering.

Three jobs, three workflows

Checking a download

The publisher lists a checksum next to the file. You hash your copy and compare. Only compare values from the same algorithm; a SHA-256 value will never match an MD5 value.

Checking a copy or backup

Hash the original, hash the copy, compare. No published value is needed. This is the most reliable way to confirm that a backup to a USB drive, NAS or cloud folder was not silently damaged, especially for large archives and disk images.

Publishing checksums for your own files

Generate a checksum file, conventionally named SHA256SUMS, with one line per file in the format <hash> <filename>, and publish it alongside your release. Users can then verify every file with a single command.

Calculate checksums with our tool

The File Checksum Calculator reads files from your disk in chunks and hashes them in the browser. Files are never uploaded, which matters for backups and private documents.

  1. Tick the algorithms you need: MD5, SHA-1, SHA-256, SHA-384 or SHA-512. SHA-256 alone is enough for most jobs.
  2. If you have a published value, paste it into Expected hash to compare. The tool detects the algorithm from the hash length.
  3. Drop one or more files onto the box, or click Drop files here or click to choose.
  4. Watch the progress bar. Very large files switch to a streaming mode that keeps memory low; you can cancel a long job.
  5. Read the result card. It turns green with "matches the expected hash — the file is intact" or red with "does NOT match".
  6. Use Copy sha256sum line to get a line in the standard checksum-file format for publishing or record keeping.

To compare an original and a copy, drop both files at once and compare their SHA-256 values side by side.

Command-line methods

The built-in tools are excellent, and for scripting or many files they are the better choice.

Windows

PowerShell's Get-FileHash defaults to SHA-256:

Get-FileHash .\backup-2026-09.zip
Get-FileHash .\backup-2026-09.zip -Algorithm SHA512

# Compare against a published value (comparison is case-insensitive)
(Get-FileHash .\installer.exe).Hash -eq "PASTE_EXPECTED_HASH_HERE"

The older certutil command works in both Command Prompt and PowerShell:

certutil -hashfile installer.exe SHA256

macOS

shasum -a 256 installer.dmg
shasum -a 256 -c SHA256SUMS

Linux

sha256sum release-1.4.2.tar.gz

# Create a checksum file for everything in a release folder
sha256sum *.tar.gz *.zip > SHA256SUMS

# Verify every file listed; prints OK or FAILED per line
sha256sum -c SHA256SUMS

Node.js

For a script that checks many files, stream the file rather than reading it all into memory:

const crypto = require("node:crypto");
const fs = require("node:fs");

function sha256File(path) {
  return new Promise((resolve, reject) => {
    const hash = crypto.createHash("sha256");
    fs.createReadStream(path)
      .on("data", (chunk) => hash.update(chunk))
      .on("end", () => resolve(hash.digest("hex")))
      .on("error", reject);
  });
}

sha256File(process.argv[2]).then((h) => console.log(`${h}  ${process.argv[2]}`));

Its output uses the same two-space format as sha256sum, so the lines can go straight into a SHA256SUMS file.

What a matching checksum does not prove

A checksum only proves that your file matches the value you compared it against. If an attacker can replace the download, they can often replace the checksum on the same web page too. That is why many projects sign their checksum file with GPG or a similar tool, or publish it on a separate trusted channel. For security-sensitive downloads, verify the signature on SHA256SUMS as the project's documentation describes, then check the file against it.

Also keep hashing and authentication separate in your head. A plain hash has no secret, so anyone can compute one. When two systems need to prove a message came from each other, they use a keyed hash such as an HMAC, which our HMAC Generator can produce.

Troubleshooting mismatches

The hash does not match the published value

Check you used the same algorithm, then re-download. Partial downloads and captive-portal pages saved with the right filename are common causes. Also confirm the version number: the checksum for 1.4.2 will not match 1.4.1.

The copy does not match the original

Hash both again. If the mismatch repeats, the copy is damaged, often due to a failing drive, a flaky USB cable or a sync tool that was interrupted. Copy it again and re-check before deleting the original.

Upper case versus lower case

Hex hashes are case-insensitive. A3F1 and a3f1 are the same value. Tools differ in how they display them, so compare ignoring case.

Text files that "should" be the same

Line endings (CRLF on Windows, LF elsewhere), a byte-order mark or a trailing newline make files differ at the byte level. For hashing short text rather than files, use the Hash Generator; the guide What Is a SHA-256 Hash and How Do You Generate or Check One? explains why text hashes can differ unexpectedly.

Frequently asked questions

Which checksum algorithm should I use?

Use SHA-256 unless the publisher only provides another algorithm. It is fast, universally supported and not vulnerable to the collision attacks that affect MD5 and SHA-1.

Can two different files have the same SHA-256 hash?

In theory collisions exist, but no one has ever found one for SHA-256. In practice a SHA-256 match means the files are identical.

Does renaming a file change its checksum?

No. The hash is calculated from the file's contents only. The name, dates and permissions are not included.

How long does hashing a large file take?

It depends mostly on disk speed. Hashing reads the entire file once, so a large disk image takes about as long as copying it from the same drive.

Is a checksum enough to prove a download is safe?

It proves the file matches the published value, not that the publisher or the page is trustworthy. For security-critical software, also verify the publisher's signature.

Try it now: File Checksum Calculator

Loading tool…