Skip to content
86% off$349 $48.86code BF2026

Docs

Bytepliers docs37 pages

sha256sum: command not found on Mac: use shasum -a 256

Fix "sha256sum: command not found" on a Mac with shasum -a 256 or openssl, compare a published checksum, and hash a file without Terminal.

Updated 5 min read

On this page

You typed sha256sum to check a download and got this:

text
-bash: sha256sum: command not found

In zsh, the default shell on current macOS, the wording is zsh: command not found: sha256sum. Same problem, same fix.

Why it happens

sha256sum belongs to GNU coreutils, which is standard on Linux. macOS ships BSD-style tools instead, so the command simply does not exist unless you install coreutils yourself (for example through a package manager). You do not need to. macOS includes two commands that print the same SHA-256 digest:

  • shasum, which defaults to SHA-1 unless you pass -a 256.
  • openssl dgst, which prints the digest in a different layout.

Most "command not found" reports for this command come from people following a Linux tutorial or a download page written for Linux. The checksum itself is just as valid on a Mac.

Fix it with shasum or openssl

Either command works on macOS 14 Sonoma, 15 Sequoia and 26 Tahoe. Nothing needs installing.

Use shasum

bash
shasum -a 256 ~/Downloads/example.dmg

This prints the SHA-256 digest followed by the file name, the same layout sha256sum uses on Linux. Omitting -a 256 gives you SHA-1, which will not match a SHA-256 checksum.

Use openssl

bash
openssl dgst -sha256 ~/Downloads/example.dmg

This prints SHA256(<file>)= <digest>. The digest is identical; only the layout differs.

Fix a script that calls sha256sum

If a script you copied calls sha256sum, change that call to shasum -a 256. The output layout matches, so the rest of the script should keep working.

Compare against a published checksum

If the download page gives you a checksum, shasum can do the comparison. Run this from the folder containing the file, with two spaces between the digest and the file name:

bash
echo "PASTE_PUBLISHED_DIGEST  example.dmg" | shasum -a 256 -c -

It prints example.dmg: OK on a match and example.dmg: FAILED on a mismatch. It changes nothing on your system.

Hash a file without Terminal

If you want an interface instead of a command, the Hash Generator in Bytepliers has a File tab for exactly this. We make Bytepliers, which is part of MacSuite; it runs free for 7 days. For a one-off check, the built-in shasum is perfectly good.

  1. Open Bytepliers and choose Hash Generator in the sidebar, or press ⌘5.
  2. Click the File tab.
  3. Drop the file on the window, or click Open File… (⌘O).
  4. Wait for the hash to finish. The file is read in 1 MB chunks with a progress indicator and elapsed time. Press ⎋ or click Cancel to stop.
  5. Paste the published checksum into the Expected checksum field. It accepts hex, Base64, or a whole sha256sum or BSD-style line, and picks the algorithm from the length of what you pasted.
  6. Read the result: it shows a match or a mismatch.

SHA-256 is the default algorithm. The tool also offers MD5, SHA-1, SHA-224, SHA-384, SHA-512, SHA3-256, SHA3-512, Keccak-256, BLAKE2b-256, CRC32, Adler-32 and xxHash64, with hex, uppercase hex or Base64 output. There is also an HMAC option with a key you type in; the key stays in memory only.

Use Choose Another… to switch files or Remove to clear the current one. Only one file can be hashed at a time.

File hashes are never saved to history, and copies are marked concealed so clipboard managers that honor that convention skip them. Hashing happens on your Mac; the file is not uploaded anywhere.

The command-line route in Bytepliers

For scripts, the bytepliers hash command (default SHA-256) is available too. It needs a one-time install in Settings and a license or active trial. See the command-line tool.

Hash an .app or other folder

A checksum belongs to a single file, and an .app such as Install macOS is a folder. Bytepliers refuses it with "Folders can't be hashed. Choose a file." and shasum returns an error about a directory.

  • Hash the download instead. Publishers normally list the checksum of the DMG, ZIP or PKG, not the app inside. Hash that file.
  • Hash the executable inside. Do this only if a source gives the checksum of a specific inner file. Right-click the app, choose Show Package Contents, and open Contents then MacOS to find the file name. Then point at it directly:
bash
shasum -a 256 "/Applications/Some App.app/Contents/MacOS/Some App"

In Bytepliers, you can drop that same inner file on the File tab.

Common causes and fixes

SymptomLikely causeFix
command not found: sha256sumGNU coreutils not installedUse shasum -a 256
No such file or directoryWrong path or unescaped spacesDrag the file into Terminal
Error about a directory, or "Folders can't be hashed. Choose a file."You pointed at a folder or .appHash the DMG or ZIP, or the file inside the bundle
Digest differs from the published oneIncomplete download, different file or version, or wrong algorithmDownload again; confirm the page says SHA-256, not SHA-1 or MD5
Digest is the wrong lengthshasum run without -a 256 (that gives SHA-1)Add -a 256
Bytepliers won't run the toolTrial ended and no license enteredEnter a key in the MacSuite License window (Enter License… in the app menu)

Checklist before you compare

  • The checksum is from the publisher's own page, not a mirror or a comment.
  • The algorithm matches (SHA-256 is 64 hex characters).
  • You hashed the exact file the checksum was published for (the DMG, not the app inside).
  • The download finished and the file name has no .download or .crdownload suffix.
  • Letter case does not matter for hex digests, so ignore upper versus lower case.

If nothing works

If the digest still differs after a fresh download, contact the publisher of the software. If Bytepliers itself misbehaves, use MacSuite support. Include the exact error text, the file name and size, which algorithm you used, and the published checksum.

text
Hello,

I downloaded <file name> (<size>) from <page>. The page lists this SHA-256:
<published digest>

My Mac computes:
<your digest>

I used: shasum -a 256 <file>
I already re-downloaded the file once. Is the published checksum current?

macOS version: <version>

Common questions

Can I install sha256sum on a Mac instead?

Yes, by installing GNU coreutils through a package manager, but there is no need. shasum -a 256 gives the same digest and is already there.

Is shasum -a 256 the same as sha256sum?

Both compute SHA-256 and print the digest followed by the file name, so the results match for the same file.

Why does shasum print a different hash than the website?

Usually the wrong algorithm (no -a 256), a different file than the one hashed, or a damaged download. Re-download and check the algorithm named on the page.

Can Bytepliers hash text too?

Yes. The Hash Generator has a Text tab (the default) that lists digests for the text you enter, alongside the File tab.

Every app.
One purchase.