Guides

How to Verify a File Checksum (MD5, SHA-256)

Check that a download is complete and unchanged by comparing its MD5, SHA-1, SHA-256 or SHA-512 checksum with the publisher's value, in a browser or terminal.

What a checksum actually is

A checksum, also called a hash, is a short string of letters and numbers calculated from every byte of a file. The same file always produces the same checksum, and changing even a single byte produces a completely different one. That makes it a quick way to answer one question: is the file I have exactly the same as the file the publisher made?

Software projects, operating system downloads and firmware pages often list a checksum next to each download, usually labelled SHA256 or similar. Sometimes it is in a separate small file with a name such as SHA256SUMS or a .sha256 extension. By calculating the checksum of your copy and comparing, you can confirm the download is complete and has not been altered.

MD5, SHA-1, SHA-256 and SHA-512

These are different hash algorithms. They produce checksums of different lengths, written in hexadecimal:

  • MD5: 32 characters. Fast and still common, but it is broken for security purposes because it is possible to create two different files with the same MD5.
  • SHA-1: 40 characters. Also considered broken for security use.
  • SHA-256: 64 characters. The current standard choice for verifying downloads.
  • SHA-512: 128 characters. Part of the same SHA-2 family as SHA-256, with a longer output.

You do not get to choose the algorithm freely: use whichever one the publisher lists, because a SHA-256 value can only be compared with another SHA-256 value. The length of the published string is a useful clue if the label is missing. MD5 and SHA-1 are still fine for spotting an incomplete or corrupted download, but they should not be relied on as security signatures. If SHA-256 is offered, use it.

Check a file in your browser

Our file hash checker calculates the checksum on your device. The file is never uploaded, which matters for large private files such as backups or installers for internal software.

  1. Open the tool and choose the downloaded file.
  2. Select the algorithm the download page uses: MD5, SHA-1, SHA-256 or SHA-512.
  3. Paste the published checksum into the comparison box.
  4. Run it and read the result. A match means your file is identical to the one the checksum was made from.

The tool handles files up to 100 MB each. For larger downloads, such as operating system images, use the built-in command-line tools described below.

Use the command line on Windows, macOS or Linux

Every major operating system can calculate checksums without installing anything. Replace the file name with your own.

On Windows, open Command Prompt or PowerShell in the folder that holds the file and run:

certutil -hashfile installer.exe SHA256

You can replace SHA256 with MD5, SHA1 or SHA512. In PowerShell, Get-FileHash installer.exe gives a SHA-256 value by default.

On macOS, open Terminal and run:

shasum -a 256 installer.dmg

Use -a 512 for SHA-512 or -a 1 for SHA-1, and md5 installer.dmg for MD5.

On Linux, run:

sha256sum installer.iso

There are matching commands named md5sum, sha1sum and sha512sum. If the project provides a checksum file, sha256sum -c SHA256SUMS checks every file listed in it and reports OK or FAILED for each.

How to compare the values correctly

Comparing 64 characters by eye is error-prone, so let a tool do it where possible. If you must compare manually, a few points help:

  • Upper and lower case do not matter. A1B2 and a1b2 are the same hexadecimal value.
  • Spaces, line breaks and the file name printed after the hash are not part of the checksum.
  • Checking only the first and last few characters is a shortcut, not a proof. Compare the whole string.
  • Make sure you are comparing against the checksum for the exact file you downloaded. Download pages often list many versions and platforms side by side.

If you are comparing whole lists of checksums, for example to confirm that every file in a backup matches the originals, paste both lists into the diff checker to highlight the lines that differ. And if you need the hash of a piece of text rather than a file, the SHA-256 hash generator does that locally; just remember that an extra space or line break in the text gives a completely different hash.

Why checksums do not match

A mismatch means the files are different. The most common reasons are ordinary:

  • The download was interrupted or corrupted. Delete the file and download it again.
  • You compared against the wrong entry, such as the checksum for a different version, a 32-bit build or another operating system.
  • You used a different algorithm from the one published.
  • The file was modified after publication, possibly by malware or a compromised mirror.

If a fresh download from the official site still does not match, do not run the file. Contact the publisher or wait until they confirm the correct value.

What a checksum does not prove

A matching checksum shows that your file is identical to the one the published value was calculated from. It does not show that the publisher, or the file, is trustworthy. If an attacker controls the website, they can replace both the file and the checksum listed next to it, and the two will match perfectly.

To reduce this risk, get the checksum from the official project site over HTTPS rather than from a mirror, and treat files from unknown sources with caution regardless of their hash. Some projects also publish digital signatures (for example, GPG signatures) for their checksum files. Verifying a signature confirms who created the checksums, which a checksum alone cannot do.

Common questions

Which checksum should I use, MD5 or SHA-256?

Use the one the publisher lists, because you can only compare like with like. If several are offered, choose SHA-256 or SHA-512. MD5 and SHA-1 still detect accidental corruption but are no longer considered safe against deliberate tampering.

Is it safe to check a file's hash online?

Our file hash checker calculates the checksum in your browser, so the file itself is not uploaded to any server. That makes it suitable for private files up to 100 MB. For larger files, the built-in certutil, shasum or sha256sum commands work offline.

If the checksum matches, is the file safe to run?

Not necessarily. A match only proves your copy is identical to the file the publisher's checksum was made from. If the source itself is malicious or the website was compromised, the file and checksum can both be bad, so download only from sources you trust.

Last updated:

Useful next steps