How to Check a SHA-256 Checksum on Windows, Mac, and Linux
Verify a downloaded file with PowerShell Get-FileHash, shasum, or sha256sum. Compare hashes correctly and understand what a checksum can prove.
Get the expected checksum from the publisher
A checksum is a compact fingerprint of a file’s bytes. Download the expected SHA-256 value from the publisher’s official release page or verified checksum manifest. Match the exact version, operating system, architecture, and archive format; a ZIP file and an installer for the same program have different hashes.
A matching hash helps establish that your file matches the reference. If an attacker can replace both the download and the checksum, the comparison does not establish authenticity. A signed release or signed checksum manifest provides a separate verification step when the publisher supports it.
Windows: use Get-FileHash in PowerShell
Open PowerShell in the download directory and replace example.zip with your filename. LiteralPath treats the filename literally, which avoids interpreting characters such as square brackets as wildcard syntax. The command reads the file without executing it.
Get-FileHash -LiteralPath "./example.zip" -Algorithm SHA256
# To print only the hash:
(Get-FileHash -LiteralPath "./example.zip" -Algorithm SHA256).HashmacOS and Linux: calculate the file hash
Run the appropriate command from the folder containing the download. Quote paths with spaces. The output contains the hexadecimal hash followed by the filename; compare the hash field with the publisher’s value.
Hashing a large disk image may take a while because the tool must read all its bytes. Wait for the command to finish before copying the result. A downloaded archive’s checksum applies to the archive itself, not to an extracted file inside it.
# macOS
shasum -a 256 "./example.zip"
# Linux (GNU coreutils)
sha256sum "./example.zip"
# Linux: verify a trusted checksum manifest
sha256sum --check SHA256SUMSCompare the whole value, then investigate mismatches
A SHA-256 value contains 64 hexadecimal characters. Uppercase and lowercase A–F represent the same digits. Compare the full value, not only the first or last few characters.
If the values differ, stop using the file until you understand why. Check that the download completed, that you selected the right release, and that the expected checksum is SHA-256 rather than SHA-1 or SHA-512. Re-download from the official source and compare again.
A mismatch does not by itself prove malware: a partial download, wrong release, or changed archive also changes the hash. It does mean that the file is not byte-for-byte the expected download for practical verification purposes.
- Confirm the algorithm is SHA-256 on both sides.
- Check the release version, platform, and filename.
- Compare all 64 hex characters, ignoring only letter case.
- Investigate any mismatch before running or installing the file.
Text hashing is different from hashing a file
The DevX Tool hash generator hashes UTF-8 text entered in its field. It does not upload or inspect a file from your disk. Use the terminal commands above to verify downloads; pasting a filename into a text hash tool hashes the filename, not the file contents.
For a reproducible text example, enter abc with no newline. Its SHA-256 is shown below. Adding a newline, changing line endings, or changing the Unicode normalization of text changes the underlying bytes and can change the hash.
ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015adFrequently asked questions
Does a matching SHA-256 checksum mean a file is safe?
It means the file matches the expected hash for practical integrity verification. Safety also depends on trusting the publisher and obtaining an authentic reference checksum. A hash alone does not scan for malware.
Can I recover a file from its SHA-256 hash?
No. A hash is not a reversible encoding of the file. To recover a missing file, obtain another copy from a backup or the original source.
References
Check the official documentation for command options and runtime-specific behavior.
Integrated Tools & Learning Resources
DevX Tool combines deep engineering tutorials with client-side interactive tooling so you can test code, verify outputs, and troubleshoot bugs right away.
Related tutorials and articles
Argon2id vs bcrypt vs SHA-256 for Password Hashing
Why You Must Never Hash Passwords with SHA-256: The Math Behind GPU/ASIC Cracking vs Argon2id and BCrypt
Read article Security & AuthMerkle Trees Explained: Hashes and Data Verification
How Merkle Trees and Cryptographic Hashes Power Git, BitTorrent, and Blockchain Consensus
Read article Security & AuthPrevent Timing Attacks When Comparing Hashes
Eliminating Timing Attacks: Why String Equality (===) Breaks Security in Cryptographic Hash Verification
Read article Web troubleshootingHTTP Error Codes: 400, 401, 403, 404, 429 & 500
Find what common HTTP errors mean, what to check in an API response, and when a retry can help. Includes a status-code comparison and debugging steps.
Read article