How to Calculate an MD5 Hash: The Complete Guide

Nov 1, 20257 min read

A step-by-step guide to calculating MD5 hashes and checksums for text and files on Windows, macOS, and Linux, plus the easiest online tool.

How to Calculate an MD5 Hash: The Complete Guide

Whether you're downloading software, verifying a backup, or just confirming a file hasn't been corrupted, calculating an MD5 hash is a fundamental integrity check. An MD5 hash (or checksum) is a 128-bit fingerprint that is unique for a given file or piece of text. If a single bit changes, the hash changes completely.

This guide provides simple, actionable steps to calculate MD5 hashes on any platform.

The easy way: Use an online tool

For a quick, hassle-free check on any operating system, a browser-based tool is the fastest option. CipherTools provides a secure, client-side solution that processes everything locally—no data ever leaves your machine.

How to calculate MD5 in Windows

Windows has a built-in utility called certutil that can calculate various hashes, including MD5.

  1. Open Command Prompt or PowerShell. You can find it by searching in the Start Menu.
  2. Use the following command structure:
bash
CertUtil -hashfile C:\path\to\your\file.zip MD5
  1. Replace C:\path\to\your\file.zip with the actual path to your file.
  2. Press Enter. The command will output the MD5 hash of the file.
text
MD5 hash of file C:\Users\Example\Downloads\installer.exe:
f5c1b0722c83b3127598f828e0a349c2
CertUtil: -hashfile command completed successfully.

How to calculate MD5 on macOS

On macOS, the md5 command is available by default in the Terminal.

  1. Open the Terminal app (you can find it in Applications > Utilities).
  2. Use the md5 command followed by the file path:
bash
md5 /path/to/your/file.zip
  1. A handy trick is to type md5 (with a space) and then drag the file from Finder into the Terminal window. This automatically pastes the correct path.
  2. Press Enter. The output will look like this:
text
MD5 (/Users/Example/Downloads/archive.zip) = 5e8f395a1278f20a7114b7524e9b33b0

How to calculate MD5 on Linux

Most Linux distributions include the md5sum utility for this exact purpose.

  1. Open your terminal.
  2. Use the md5sum command with the path to your file:
bash
md5sum /path/to/your/file.zip
  1. Press Enter. The output will show the hash followed by the filename.
text
a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4  /home/example/documents/data.tar.gz

Whether you prefer a simple online tool or your native command line, calculating an MD5 hash is a quick and effective way to ensure your files are exactly as they should be.