Want to check SHA1, SHA256, SHA384, SHA512, or MD5 hash for a file? You can do it without using any third-party tools in Windows. Here’s how.
When you download a file from the internet, including email attachments, how do you verify that it’s actually the file you think it is? Furthermore, how can you be sure it hasn’t been modified—either in transit (while downloading), by other applications, or by malware on your system? That’s where file hashes come into play. A file hash uniquely identifies a file. Even a small change in the file contents will change the file hash completely. You can compare the file hash of the downloaded file with the file hash provided by the developer to verify that the file is authentic and unaltered.
For example, when you download Windows 11 ISO from the Microsoft website, it will also display the file hash. You generate the file hash using the steps below and then compare it with the official hash provided by Microsoft to ensure the downloaded ISO is authentic and unaltered.
In this quick and simple tutorial, I will show the steps to check the file hash of any file using the Get-FileHash PowerShell cmdlet in Windows 11 and Windows 10. It can generate various hash types, including SHA1, SHA256, SHA384, SHA512, and MD5. Let’s get started.
Check File Hash for Any File in Windows 11 & 10
We’ll use PowerShell with the Get-FileHash cmdlet to generate the file hash for any file. It is a simple command that generates a SHA256 file hash by default, but you can use the -Algorithm
parameter to compute hashes in other cryptographic hash functions such as SHA1, SHA384, SHA512, and MD5. Here’s how.
First, we must open the PowerShell tool. To do that, right-click the “Windows” icon on the taskbar and select “Terminal“. Windows 10 users can select the “Windows PowerShell” option.

Once the Terminal/PowerShell window opens, run the following command. Don’t forget to replace the dummy file path with the actual file path. The command outputs the cryptographic hash function (SHA256, by default) used and its file hash.
Note: Depending on the file size, it may take a few seconds to calculate the file hash.
Get-FileHash "C:\path\to\file.txt"

To get the file hash using other cryptographic hash functions, run the following commands. Don’t forget to replace the dummy path with the actual file path.
Get SHA1 hash for a file:
Get-FileHash "C:\path\to\file.txt" -Algorithm SHA1
Get SHA384 hash for a file:
Get-FileHash "C:\path\to\file.txt" -Algorithm SHA384
Get SHA512 hash for a file:
Get-FileHash "C:\path\to\file.txt" -Algorithm SHA512
Get MD5 hash for a file:
Get-FileHash "C:\path\to\file.txt" -Algorithm MD5
Once the file hash is displayed in the PowerShell/Terminal window, compare it with the file hash on the download page to ensure the file’s authenticity.

Important: Ensure you are comparing hashes generated using the same cryptographic algorithm. For instance, if the source provides a SHA512 hash, you must also generate a SHA512 hash for your downloaded file before comparing. Never attempt to compare hashes from different algorithms (e.g., MD5 vs. SHA256).
Good to know: How to add an option to calculate file hash in the right-click menu
—
That is all. It is that simple to check the file hash of any file in both Windows 11 and Windows 10. If you have any questions or need help, comment below.