Verify SHA256 checksum of a file on Mac

Just downloaded a file from the internet and want to verify the SHA256 checksum of the file to ensure its integrity? There are different methods to verify sha256 hash of a file on the Mac. For example, you can easily check the SHA 256 checksum of any file from the command line. To do that, simply follow below steps.

On your Mac, open the Launchpad, find and open the Other folder, you can find the Terminal app there. Or you can quickly find it through the Spotlight Search. Launch Terminal and then use the following command to verify the SHA256 checksum of a file on Mac.

shasum -a 256 /path/to/file

To find out the path to the file, open Finder, find the file, and right click on it, then choose Get Info from the context menu. The file properties opens and provide you the file type, file size, file location, created date, modified date, file source, name & extension and other information. In fact, you can simply drag the file from Finder and drop it to the Terminal window, you will see that the file path and name inserted automatically in Terminal. Press Enter or Return key on the keyboard to execute the command line, you will then get the SHA256 checksum of the file.

Verify SHA256 checksum of a file Terminal on Mac

Compare the SHA256 checksum with the one you find from the source where you downloaded the file to verify its integrity. If the two strings do not match, discard the file and attempt the download again.

Leave a Reply