How to Calculate an MD5 Hash: The Complete Guide
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.
- To hash text: Use the MD5 Text Hash tool.
- To hash a file: Use the MD5 File Hash tool.
How to calculate MD5 in Windows
Windows has a built-in utility called certutil that can calculate various hashes, including MD5.
- Open Command Prompt or PowerShell. You can find it by searching in the Start Menu.
- Use the following command structure:
CertUtil -hashfile C:\path\to\your\file.zip MD5- Replace
C:\path\to\your\file.zipwith the actual path to your file. - Press Enter. The command will output the MD5 hash of the file.
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.
- Open the Terminal app (you can find it in Applications > Utilities).
- Use the
md5command followed by the file path:
md5 /path/to/your/file.zip- 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. - Press Enter. The output will look like this:
MD5 (/Users/Example/Downloads/archive.zip) = 5e8f395a1278f20a7114b7524e9b33b0How to calculate MD5 on Linux
Most Linux distributions include the md5sum utility for this exact purpose.
- Open your terminal.
- Use the
md5sumcommand with the path to your file:
md5sum /path/to/your/file.zip- Press Enter. The output will show the hash followed by the filename.
a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4 /home/example/documents/data.tar.gzWhether 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.