How to get MD5 checksum or SHA1, SHA256, SHA512 of a file on Windows

Windows comes with a built-in command to get MD5 checksum of file

1. To get MD5

certutil -hashfile <filename> MD5

2. To get sha1

certutil -hashfile <filename> SHA1

3. To get sha256

certutil -hashfile <filename> SHA256

4. To get sha512

certutil -hashfile <filename> SHA512

To see all the algorithms supported, see below

C:\Users\mvr12>certutil -hashfile -?
CertUtil [Options] -hashfile InFile [HashAlgorithm]
Generate and display cryptographic hash over a file

-Unicode — Write redirected output in Unicode
-gmt — Display times as GMT
-seconds — Display times with seconds and milliseconds
-v — Verbose operation
-privatekey — Display password and private key data
-pin PIN — Smart Card PIN
22 — Local System
23 — Local Service
24 — Network Service

Hash algorithms: MD2 MD4 MD5 SHA1 SHA256 SHA384 SHA512

CertUtil -? — Display a verb list (command list)
CertUtil -hashfile -? — Display help text for the “hashfile” verb
CertUtil -v -? — Display all help text for all verbs

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply