TECH / Software & Services 3 min read

How to Calculate File Hash (SHA-256, SHA-1, MD5, CRC32) on Windows, Linux, and macOS

Antonio NEMCD Author
Published Feb 20, 2011 · 3 min

Whenever you download a large OS ISO image, installer, or archive, the publisher usually lists its checksum (hash) – typically SHA-256, or older SHA-1, MD5, and CRC32. Comparing hashes confirms the file downloaded cleanly without corruption or tampering.

Calculating SHA1, MD5, and CRC32 file hashes in HashMyFiles

Years ago you had to download extra tools like Microsoft’s discontinued FCIV, but today Windows, Linux, and macOS all have fast hash commands built right in – nothing to install.

On Windows Without Extra Software: PowerShell and cmd

PowerShell (Windows 10, 11, and Server) includes Get-FileHash, which defaults straight to modern SHA256:

Get-FileHash "C:\Downloads\file.iso" -Algorithm SHA256

Swap SHA256 for MD5, SHA1, SHA384, or SHA512 as needed. Even better, let PowerShell compare the 64-character string for you instead of squinting at it (returns True or False):

(Get-FileHash "C:\Downloads\file.iso" -Algorithm SHA256).Hash -eq "PASTE_EXPECTED_HASH_HERE"

In classic Command Prompt (cmd), built-in certutil works everywhere:

certutil -hashfile file.iso SHA256
certutil -hashfile file.iso MD5
certutil -hashfile file.iso SHA1

On Linux, FreeBSD, and macOS

  • Linux (Ubuntu, Debian, Fedora, etc.): run sha256sum file.iso, sha1sum file.iso, or md5sum file.iso. If a SHA256SUMS file sits in the same folder, verify everything automatically with sha256sum -c SHA256SUMS. To hash a plain text string: printf 'text' | sha256sum.
  • macOS: shasum -a 256 file.iso (SHA-256), shasum file.iso (SHA-1), and md5 file.iso.
  • FreeBSD: sha256 file.iso and md5 file.iso.

If You Prefer a GUI (Right-Click Tools)

If you would rather not open a terminal, three reliable desktop options make checksums a two-click task:

  • 7-Zip: if 7-Zip is already installed, right-click any file → CRC SHA → pick SHA-256, SHA-1, CRC-32, or * to show all at once.
  • Total Commander: select your files and open Files → Create Checksum File(s) (supports CRC32, MD5, SHA1, SHA256, and one-click verification of .sha256 files).
  • NirSoft HashMyFiles: a tiny free portable Windows tool that hashes batches of files in MD5, SHA1, CRC32, SHA-256, and SHA-512 and optionally integrates into Explorer’s context menu. Always grab it straight from the official NirSoft page.
Which algorithm should you check? MD5 and SHA-1 are fine for catching accidental download glitches, but if security and file authenticity matter, always verify SHA-256 (or SHA-512).

On my own PC I almost always reach for 7-Zip’s context menu or PowerShell’s Get-FileHash – having PowerShell print a blunt True or False beats eyeballing 64 hex characters every time.

Related posts:

Leave a Comment