How-to · Peek Pro

How to verify a SHA-256 checksum on a Mac

A download page publishes a checksum so you can confirm that the file you received is the file they published. Checking it means calculating the checksum of your copy and comparing the two, character by character.

SHA-256 SHA-512 SHA-1 MD5 SHA256SUMS

With Peek

Calculate and compare in one step

Checksums are part of Peek Pro, which you can try free for 14 days. The Terminal way below is free and built into macOS.

1

Open the archive

Open the downloaded archive in Peek.

2

Open Checksums

Choose Archive ▸ Checksums…. Peek calculates SHA-256, SHA-512, SHA-1 and MD5.

3

Paste the published value

Paste the checksum from the download page. Peek recognises which kind it is and says whether it matches.

4

Or choose a checksum file

Choose a file such as SHA256SUMS or archive.zip.sha256, and Peek finds the line for your file.

5

Check a file inside

The same works for a file inside the archive, without extracting it first.

From the Terminal

Use shasum, which macOS includes

No install needed.

# Calculate the SHA-256 of a file
shasum -a 256 download.zip

# Compare with a published value
echo "<published-checksum>  download.zip" | shasum -a 256 -c

# Check every file listed in a SHA256SUMS file
shasum -a 256 -c SHA256SUMS

# Other algorithms
shasum -a 512 download.zip
md5 download.zip

Note the two spaces between the checksum and the file name in the echo line; with one, shasum -c reports a format error.

Questions

Does a matching checksum mean the file is safe?

It means your copy is identical to the one the checksum was made from. It says nothing about whether that original is trustworthy, and a checksum published on the same page as a tampered file can be tampered with too.

Should I still use MD5 or SHA-1?

Only to compare with a value someone published in that form. They detect accidental corruption but are not safe against deliberate tampering. Prefer SHA-256 or SHA-512 when you have the choice.

Why does my checksum not match?

Usually an incomplete download, or a different release than the one the checksum belongs to. Download again and compare the file names and versions.

Can I get the checksum of a file inside a ZIP without extracting it?

From the Terminal, unzip -p archive.zip path/to/file | shasum -a 256. In Peek Pro, Checksums works on a file inside the archive.

More how-to guides

Other things people do with a JAR or a WAR

Free to download

Open, browse and extract for free. Try Peek Pro for 14 days.

Peek is a native Mac app from the Mac App Store. Nothing is charged when the trial ends; Peek Pro is a one-time purchase, with no subscription and no account.