Windows: MD5/SHA256 CheckSum – Built-In Utility

In Windows you can make a checksum of a file without installing any additional software.

For this you can use the certUtil – built-in command-line utility that works both in Windows CMD and Powershell.

In this note i will show the examples of how to make md5sum and sha256sum of a file in Windows from the command line.

Cool Tip: zip and unzip from the command line in Windows! Read more →

MD5/SHA256 CheckSum in Windows

Checksum a file in Windows using the built-in certUtil command-line utility:

C:\> certUtil -hashfile <PATH_TO_FILE> <HASH_ALGORITHM>

MD5 checksum example (md5sum):

C:\> certUtil -hashfile C:\file.img MD5

SHA256 checksum example (sha256sum):

C:\> certUtil -hashfile C:\file.img SHA256

Get only hash value:

# Windows CMD:
C:\> CertUtil -hashfile C:\file.img MD5 | findstr /v "hash"

# Windows PowerShell:
PS C:\> $(CertUtil -hashfile C:\file.img MD5)[1] -replace " ",""

Available hash algorithms:

MD2 MD4 MD5 SHA1 SHA256 SHA384 SHA512

Hash Algorithms: Note that on Windows 7, the hash algorithms are case-sensitive. Be sure to type, for example, not “md5” but “MD5”. In the subsequent versions of Windows the case doesn’t matter.

Get help:

C:\> certutil -hashfile -?

3 Replies to “Windows: MD5/SHA256 CheckSum – Built-In Utility”

  1. I am getting the following errors:
    (what I typed or part of it) is not recognized as an internal or external command, operable program or batch file

    The filename, directory name, or volume label syntax is incorrect.

  2. are you using unc paths? depending on the windows version you mean need to put the locations within ” or ‘ brackets

  3. Thanks for the info it worked for me.

Leave a Reply