Want to check a file you downloaded for tampering? Want to verify a file on your system? Find out here how to check and verify an MD5 checksum on a Mac (as well as SHA, RIPMD or Whirlpool hashes, for example) using “md5”, “shasum” and “openssl”.
First, Mix 5 Parts Strong Instant Coffee and 3½ Parts Washing Soda
Add water to the coffee-soda mix, of course, and some vitamin C concentrate if you please.
You’ve just made a developing agent for black and white film—caffenol-c.
Now that we know how to transform film negatives into pictures to hang on the wall with nothing but a trip to the supermarket, how about transforming any file into a hash code you can verify with nothing but a trip to macOS?
How to Check an MD5 Checksum on a Mac
On Windows? How to Verify an MD5 (or SHA) Checksum on Windows 10/11
On Linux? How to Verify an MD5 or SHA Checksum on Linux
Time needed: 2 minutes
To generate and verify the MD5 checksum for a file or document on a Mac using macOS:
- Open Terminal.
- Navigate to the folder that contains the file whose MD5 checksum you want to verify.
The direct route: You can open Terminal right at a folder from Finder.
- Type
md5 <file>
.Dragging and dropping: You can also type
md5
, then drag and drop the file you want to check onto the Terminal window. - Press Enter.
How to Check SHA (SHA-1 and SHA-2/SHA 256) on a Mac
To check the SHA-1 checksum for any file on a Mac:
- Open Terminal
- Go to the folder that contains the file whose SHA checksum you want to check.
The speedy way: See above for fast folder navigation. - Type
shasum <file>
.
Different hashing function: Useshasum -a <algorithm> <file>
, replacing <algorithm> with the desired function from the table below.
SHA-2 checksum example: Typeshasum -a 256 Example.txt
to generate the SHA-2 256-bit checksum for the file Example.txt. - Press Enter.
Command | Hashing Function | Output |
---|---|---|
1 | SHA-1 secure hash algorithm 1 (160 bit) | 40 digits 640ab2bae07bedc4c163f679a746f7ab7fb5d1fa |
224 | SHA-2 224-bit secure hash algorithm | 56 digits 3606346815fd4d491a92649905a40da025d8cf15f095136b19f37923 |
256 | SHA-2 256-bit secure hash algorithm | 64 digits 532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25 |
384 | SHA-2 384-bit secure hash algorithm | 96 digits 7b8f4654076b80eb963911f19cfad1aaf4285ed48e826f6cde1b01a79aa73fadb5446e667fc4f90417782c91270540f3 |
512 | SHA-2 512-bit secure hash algorithm | 128 digits c6ee9e33cf5c6715a1d148fd73f7318884b41adcb916021e2bc0e800a5c5dd97f5142178f6ae88c8fdd98e1afb0ce4c8d2c54b5f37b30b7da1997bb33b0b8a31 |
512224 | SHA-512/224 truncated 512-bit secure hash algorithm | 56 digits c696f08d2858549cfe0929bb7b098cfa9b64d51bec94aa68471688e4 |
512256 | SHA-512/256 truncated 512-bit secure hash algorithm | 64 digits bbd4c3ba8083657894efee31469b2bc43510f95f4ca81fe3045905e804aee90c |
Speaking of “hashing”: Where to Find the Hash Key ( # ) on a Mac Keyboard
How to Verify an MD5 Checksum on a Mac: FAQ
How can I quickly check the generated sum against the expected sum?
You can use diff to compare the computed output against the known expected checksum:
diff <(md5 Example.txt) Example.txt.md5sum
Can I generate RIPEMD or Whirlpool checksums on a Mac?
Yes.
Using OpenSSL, you can generate checksums using a host of alternative hashing functions.
To verify MD5, SHA and other checksums using OpenSSL on a Mac:
- Open Terminal.
- Go to the folder that contains the file whose checksum you want to verify.
- Type
openssl <algorithm> <file>
(replacing <algorithm> with the algorithm from the table below and <file> with the filename).
RIPEMD checksum example: Typeopenssl ripemd160 Example.txt
for the RIPEMD160 checksum for Example.txt. - Press Enter.
Command | Hashing Function | Output |
---|---|---|
md4 | Message-digest algorithm 4 128-bit | 32 digits 5d9381b52cd41a87bc8fcc7726aec03a |
md5 | Message-digest algorithm 5 128-bit | 32 digits 0cbc6611f5540bd0809a388dc95a615b |
sha1 | SHA-1 secure hash algorithm 1 (160 bit) | 40 digits 640ab2bae07bedc4c163f679a746f7ab7fb5d1fa |
sha224 | SHA-2 224-bit secure hash algorithm | 56 digits 3606346815fd4d491a92649905a40da025d8cf15f095136b19f37923 |
sha256 | SHA-2 256-bit secure hash algorithm | 64 digits 532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25 |
sha384 | SHA-2 384-bit secure hash algorithm | 96 digits 7b8f4654076b80eb963911f19cfad1aaf4285ed48e826f6cde1b01a79aa73fadb5446e667fc4f90417782c91270540f3 |
sha512 | SHA-2 512-bit secure hash algorithm | 128 digits c6ee9e33cf5c6715a1d148fd73f7318884b41adcb916021e2bc0e800a5c5dd97f5142178f6ae88c8fdd98e1afb0ce4c8d2c54b5f37b30b7da1997bb33b0b8a31 |
streebog256 | GOST R 34.11-2012 streebog 256-bit hash function | 64 digits 3ebeae08f0adb274a578960a5fa71a9b561cb7659f2470fa5c86ae0df7275713 |
streebog512 | GOST R 34.11-2012 streebog 512-bit hash function | 128 digits 823b923c466cba8969f74e6735be91b7a812474dec2c344bc1aa4dea61b7c379ef196b43d4aba5ebdc0b6ad3ab9d021f35ba2e6fe9fd099b9c4a1ac36095e146 |
ripemd160 | RIPE Message Digest 160-bit | 40 digits 76c82682cd7af7e812e513fa0e7914ab40b842e0 |
gost-mac | GOST 28147 MAC algorithm | 8 digits 52efa915 |
md_gost94 | GOST R 34.11-94 hash function | 64 digits a0b1e053dd3f177d90c7989ebf6db7aa3c963b2267b7d542a20476cc3e33a3f1 |
whirlpool | Whirlpool 512-bit hash function | 128 digits ac1c196e84b05d59faea639d0cccb6c16f7568e0943f4c94c648bd8eefe5cf3978f8d4f99b1426e4ce3c6fa40e17cf68d6b86d42246333569b963ff4579c6355 |
(How to check MD5o on a Mac tested with macOS Sonoma 14.3, Ventura 13.4, Monterey 12.3 and Big Sur 11.3; updated March 2024)