How To Calculate Hash Value of Any File Using PowerShell In Windows 10

0 Comments
Editor Ratings:
User Ratings:
[Total: 0 Average: 0]




This tutorial explains how to calculate hash value of any file using PowerShell in Windows 10. You can get the hash value of almost any file (TXT, EXE, WORD, etc.) by executing a very simple command. Whether you want to calculate MD5 hash, SHA384, MACTripleDES, RIPEMD160, SHA256, SHA1, etc., you can do this using PowerShell.

Although there are many powerful third party hash calculator software available, but when you prefer native feature over 3rd party tools, then Windows 10 PowerShell is handy to generate hash value of any file.

In the screenshot visible below, you can see some hash values generated by me using PowerShell in Windows 10.

calculate hash values of files using powershell in windows 10

How To Calculate Hash Value of Any File Using PowerShell In Windows 10?

Step 1: Open PowerShell by typing its name in the Search box.

Step 2: This step helps to generate SHA256 hash of a file. You don’t have to specify the hash name. Just enter the command: get-filehash “source location of file“. Press Enter and you will see that it has calculated SHA256 hash.

SHA 256 hash generated

Step 3: Use this step when you want to generate MD5, SHA384, SHA1, SHA512, RIPEMD160, or MACTripleDES hash. Simply type this command: get-filehash -Algorithms hash name “source location of file“. Replace hash name with MD5 or SHA384 or any other supported hash name and execute the command. It will present hash value of that particular file.

calculate MD5 or some other hash

Step 4: This step is optional but works very well. This is another way to generate the hash value of a file. For this, open PowerShell, type “certutil“, and press enter key. It will create some dump command and show you message that “-dump command completed successfully“. Now to generate SHA1 hash, type certutil -hashfile “location of source file“.

user certutil to genereate hash

Step 5: To generate MD5 or some other hash, your command would be: certutil -hashfilelocation of source filehash name.

Replace hash name with MD5 or other hash and you will be able to generate that particular hash value of a file.

You may also learn to Add Open PowerShell Window Here In Windows 10 Context Menu and Bulk Uninstall Apps In Windows 10 Using PowerShell.

The Verdict:

If you rarely have to check file integrity, then you probably don’t want to use any external hash generator software. In that case, PowerShell would be one of the best options available to check hash value of a file or multiple files (one by one) and then manually check if files are identical. Just a simple command is all you need to execute to calculate hash value of any file available on your PC.

Editor Ratings:
User Ratings:
[Total: 0 Average: 0]

Get 100 GB FREE

Provide details to get this offer