Cybersecurity
How to Check a File's SHA-256 Hash in Windows
Verify that a download has not been corrupted or tampered with by checking its SHA-256 hash in Windows with PowerShell, Command Prompt or a hash checker.
Published

A file hash is a short fingerprint calculated from a file's contents. If even one byte changes, the hash changes completely. Comparing a published SHA-256 hash with the hash of the file you downloaded is one of the simplest ways to confirm that a download is complete and has not been altered.
When should you check a file hash?
- Before installing software or a disk image (ISO) from the internet.
- After copying large files to a USB drive or network share.
- When checking that backup copies match the originals.
- When a publisher lists checksums next to its downloads.
Method 1: PowerShell (recommended)
Open PowerShell and run:
Get-FileHash "C:\Users\You\Downloads\file.iso"
PowerShell uses SHA-256 by default. To choose another algorithm, add -Algorithm SHA512 (or SHA1, MD5). Compare the long string shown under "Hash" with the value published by the software provider. Letter case does not matter.
Method 2: Command Prompt with certutil
In Command Prompt, run:
certutil -hashfile "C:\path\to\file.iso" SHA256
This works on all supported versions of Windows and gives the same result as PowerShell.
Method 3: A hash checker utility
A graphical hash checker is faster when you verify files often. Good tools let you paste the expected hash and show a clear match or mismatch, process several files at once and export the results for your records.
What if the hashes do not match?
- Download the file again, ideally from the publisher's official website.
- Check you are comparing the same algorithm (SHA-256 against SHA-256).
- Make sure you have the hash for the same version of the file.
- If it still does not match, do not run the file. Contact the publisher.
Which algorithm should I use?
Use SHA-256 or stronger. MD5 and SHA-1 are still useful for spotting accidental corruption, but they should not be relied on to detect deliberate tampering.
Frequently asked questions
Does a matching hash prove a file is safe?
It proves the file is identical to the one the publisher described. It does not prove the publisher's file is free of malware, so download only from sources you trust and keep antivirus protection turned on.
Where do I find the official hash?
Reputable publishers list hashes on their download page or in a separate checksum file. Be cautious of hashes posted on third-party sites.
Related help
Read our guide to [spotting fake software downloads](https://htreasure.com/blog/spot-fake-software-downloads), or contact our [technical support](https://htreasure.com/services/technical-support) team if you need help verifying a download.