
Quick Answer
To verify a downloaded file’s SHA-256 checksum on a Mac:
- Find the checksum published by the software developer or download provider.
- Open Terminal.
- Run
shasum -a 256followed by the file’s path. - Compare the 64-character result with the published checksum.
If the two values match exactly, the file’s contents match the file used to create the published checksum. If they differ, do not install or open the file until you determine why.

What a SHA-256 checksum tells you
A SHA-256 checksum is a fixed-length string calculated from a file’s contents. Even a small change to the file normally produces a different checksum. Developers publish checksums so you can check whether a download matches the intended file.
A matching checksum helps confirm file integrity. It does not, by itself, prove that the download came from a trustworthy developer or that the software is safe. Obtain the file and its published checksum from a source you trust, and continue to follow macOS security warnings.
A SHA-256 checksum contains 64 hexadecimal characters—numbers from 0 through 9 and letters from a through f. Comparison is exact: one missing, extra, or different character means the values do not match.
Before you begin
You need:
- The downloaded file.
- The expected SHA-256 checksum from the developer or trusted download page.
- The file’s exact name and location.
- Terminal, which is included with macOS.
Do not copy a checksum from an untrusted comment, random forum post, or unrelated download page. The expected value must correspond to the exact file you downloaded. Different versions, architectures, formats, or archives can have different checksums.
If the download page provides several checksums, identify the one associated with your specific file. For example, a compressed archive and a disk image containing the same application are different files and will not normally have the same checksum.
Find the downloaded file
Most browser downloads appear in the Downloads folder. You can use Finder to confirm the file’s name, or use Terminal to list the folder.
Open Terminal from Applications > Utilities, then run this command:
ls -l ~/Downloads
The ls -l command lists items in the Downloads folder. The ~ represents your home folder. This command only reads the folder; it does not change, move, or delete anything.
Look for the downloaded file in the output. File names can contain spaces, punctuation, and parentheses, so avoid retyping a long name if possible.
Use Finder to insert the file path
You can avoid typing the path manually:
- Open Terminal.
- Type
shasum -a 256, including the space after256. - In Finder, open the folder containing the download.
- Drag the file into the Terminal window.
- Press Return.
Dragging the file into Terminal inserts its full path and automatically handles spaces and many special characters safely. The command will resemble this, although your file name will be different:
shasum -a 256 /path/to/downloaded-file
The command does not modify the file. It reads the file and calculates its SHA-256 checksum. For a large download, Terminal may take some time to finish.

Verify the checksum in Terminal
Method 1: Calculate the checksum and compare it manually
Run:
shasum -a 256 "/path/to/downloaded-file"
Replace /path/to/downloaded-file with the file’s actual path. Keep quotation marks around the path if it contains spaces. If you drag the file into Terminal, macOS inserts the path for you.
The command has two parts:
shasumcalculates a file hash.-a 256selects the SHA-256 algorithm.
Terminal prints the calculated checksum followed by the file path. Compare the checksum character by character with the expected value from the download provider.
A successful match looks conceptually like this:
calculated-checksum /path/to/downloaded-file
The displayed checksum will be specific to your file, so do not expect a particular value unless the provider published it for that exact download.
Method 2: Compare against a checksum stored in a text file
Some download pages provide a checksum file. If you have a text file containing the expected checksum and the matching file name, you can use shasum -a 256 -c to compare them automatically.
First, inspect the checksum file so you know its format:
cat "/path/to/checksum-file.txt"
cat prints the text file’s contents in Terminal. It does not edit or delete the file.
A compatible checksum file generally contains a line with the expected 64-character checksum and the file name. If the provider supplies a command or a precisely formatted checksum file, follow that provider’s instructions.
When the checksum file uses the standard format, run:
shasum -a 256 -c "/path/to/checksum-file.txt"
The -c option tells shasum to read expected values from the specified file and test the referenced files. A passing result is reported as OK; a mismatch is reported as FAILED.
This method depends on the checksum file naming the downloaded file correctly. If the file name or path does not match, the command may report that it cannot open the file even when you have the correct download. In that case, use the manual comparison method or check the provider’s instructions.

Interpret the result
The checksums match
If your calculated value exactly matches the published SHA-256 value, the downloaded file’s contents match the expected contents represented by that checksum.
You can proceed to the provider’s normal installation or opening instructions, while still paying attention to macOS security prompts. A checksum does not replace signature verification, malware protection, or careful source selection.
The checksums do not match
Do not install, open, or distribute the file yet. First check:
- The expected checksum: Confirm that you copied the value for the correct file and version.
- The downloaded file: Make sure you calculated the checksum for the intended file, not a similarly named archive or an older download.
- The file name and format: A
.zip,.dmg, installer package, or standalone executable will have a different checksum. - The download: Download the file again from the trusted source, then calculate the checksum again.
- The published value: Confirm that the checksum came from the legitimate provider’s website and was not truncated or altered when copied.
If a fresh download still produces a different checksum, contact the software provider or avoid using the file. Do not try to “fix” a mismatch by editing the downloaded file; any change creates a different checksum.
Verify a checksum without changing the file
Checksum commands in this guide read the file; they do not rename, move, delete, or modify it. There is no reversal step for the calculation itself because it changes no file state.
The main command is:
shasum -a 256 "/path/to/downloaded-file"
If you accidentally enter a path containing spaces without quotation marks, Terminal may interpret it as multiple arguments. Press Control-C to cancel a command that is still running. This does not undo a completed calculation and does not alter the file.
Be careful with commands copied from third-party instructions. A checksum command should only read the target file. Do not run additional commands that delete downloads, change permissions, remove security attributes, or install software unless you understand their purpose.
For related file-access problems, you may find it useful to check file and folder permissions in Terminal on a Mac. Permissions are separate from checksum verification: a permission problem can prevent reading a file, but changing permissions will not make a checksum match.
Troubleshooting
“No such file or directory”
The path is incorrect, or the file name was entered incorrectly. Use Finder to locate the file, then drag it into Terminal after typing:
shasum -a 256
Alternatively, list the Downloads folder again:
ls -l ~/Downloads
Check capitalization, spaces, and the file extension.
“Permission denied”
Terminal may not be able to read the file or one of its parent folders. Confirm that you selected the correct file and that it is not currently being moved or removed.
Avoid changing permissions merely to force a checksum calculation. If you need to investigate access, review the file’s permissions first. A permission change can affect who or what can access the file, so preserve the original state before making any change and restore it afterward if necessary.
The command appears to stop
Calculating a checksum can take time for a large file or a slow storage device. Wait for the command to finish. Do not close Terminal or disconnect an external drive while the file is being read.
If you need to stop a running calculation, press:
Control-C
This interrupts the current command. It does not delete or modify the file. Run the checksum command again when the file is available.
The automated check reports a missing file
The checksum file may refer to a file name that is not in the current folder, or its expected format may not be compatible with the command. List the folder contents:
ls -l ~/Downloads
Then calculate the checksum manually for the actual downloaded file:
shasum -a 256 "/path/to/downloaded-file"
Compare that output with the published value.
The checksum matches, but macOS still shows a warning
Checksum verification and macOS security checks answer different questions. A checksum confirms that the file matches the published contents; it does not verify the developer’s identity or remove macOS protections.
Do not bypass a warning simply because the checksum matches. If you need to investigate an application’s signature or Gatekeeper status, use information from the developer and follow a documented, trusted procedure. You can also check Gatekeeper status and app signatures using Terminal on a Mac.
The download has an unexpected quarantine attribute
Downloaded files can include metadata that macOS uses for security checks. That metadata is separate from the file’s SHA-256 contents. Removing it does not repair a checksum mismatch and can reduce a security safeguard.
Do not remove quarantine metadata just to make an application open. If a trusted workflow specifically requires investigating it, read how to remove a quarantine attribute from a Mac file safely first.
Frequently Asked Questions
Does a matching SHA-256 checksum mean the file is safe?
No. It means the file matches the contents represented by the published checksum. You must still consider the download source, the developer, the file type, macOS security warnings, and other available verification methods.
Can I verify a folder with shasum?
shasum is designed to calculate a checksum for a file. For a folder, create a carefully defined archive or checksum each file individually. Different archive settings can produce different archive checksums, so use the provider’s stated method.
Does changing a file change its checksum?
Yes. Any content change can produce a different SHA-256 value. Renaming a file normally does not change its contents, but editing, recompressing, or converting it generally does.
Can I use a checksum from a different version?
No. Use the checksum published for the exact file you downloaded. An update, language edition, architecture, or different packaging format may have a different checksum.
Is SHA-256 case-sensitive?
Hexadecimal letters can appear in uppercase or lowercase and represent the same numeric value. However, do not omit characters, add spaces within the value, or compare only part of it. Compare the complete 64-character checksum.
Final Thoughts
On a Mac, the simplest verification method is:
shasum -a 256 "/path/to/downloaded-file"
Compare the complete result with the checksum published for that exact download. A match confirms the file contents; a mismatch means you should stop, recheck the file and source, and download it again if necessary.