What Is a Hash? SHA-256 and File Checks Explained Simply
Updated 27 September 2026 · 5 min read
A hash is a fixed-length fingerprint of some data. Feed in one word or a 4 GB file and you get a short string of letters and numbers; change a single byte and the fingerprint changes completely. Its most useful everyday job is checking that a file you downloaded is exactly the file the publisher released.
What a hash function does
A hash function takes input of any size and produces output of one fixed size, called a digest. SHA-256, the most widely used today, always gives 256 bits, written as 64 hexadecimal characters (0 to 9 and a to f). Here is what it gives for two almost identical words:
hello→2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824Hello→185f8db32271fe25f561a6fc938b2e264306ec304eda518007d1764826381969
One capital letter, and nothing in the result stays the same. That sensitivity is the point: if even one bit of a file is damaged or altered, its hash won't match.
The properties that make hashes useful
- Deterministic. The same input always gives the same hash, on any computer.
- Fixed length. The output size depends on the algorithm, not the input.
- Avalanche effect. A tiny change to the input changes roughly half the output bits, as the example shows.
- One-way. You can't work backwards from a hash to the input. The only route is guessing inputs and comparing, which is why hashes of short, common inputs are easy to look up.
- Collision resistant. It should be practically impossible to find two different inputs with the same hash. This is the property that has failed for MD5 and SHA-1.
| Algorithm | Output size | Hex characters | Status |
|---|---|---|---|
| MD5 | 128 bits | 32 | Broken |
| SHA-1 | 160 bits | 40 | Broken for collisions, being retired |
| SHA-256 | 256 bits | 64 | Current standard |
| SHA-384 | 384 bits | 96 | Current |
| SHA-512 | 512 bits | 128 | Current |
If a download page lists a hash without naming the algorithm, count the characters: 64 almost always means SHA-256.
How to verify a download, step by step
- Find the official checksum. Look on the publisher's own download page for a value labelled SHA-256, or a file with a name like
SHA256SUMS. Take it from the official site over HTTPS, not from a forum post or a mirror. - Download the file and note where it was saved.
- Calculate its hash. On Windows, open Command Prompt and run
certutil -hashfile "C:\Users\you\Downloads\file.iso" SHA256(Microsoft's certutil reference). The hash appears on the second line of the output. In PowerShell,Get-FileHash .\file.isodoes the same job and uses SHA-256 by default. On macOS or Linux, open Terminal and runshasum -a 256 file.iso. Most Linux systems also havesha256sum file.iso. - Compare every character. Upper and lower case don't matter:
Get-FileHashprints capitals, the others print lowercase. Don't just glance at the first and last few characters. In PowerShell you can let the computer compare:(Get-FileHash .\file.iso).Hash -eq "paste-the-published-hash"returns True or False. On Linux, with a downloadedSHA256SUMSfile in the same folder,sha256sum -c --ignore-missing SHA256SUMSprintsfile.iso: OKfor each file that matches. - If it doesn't match, delete the file and download it again from the official source. If it still doesn't match, don't open or install it.
A matching hash proves the file is identical to the one the checksum describes. It doesn't prove the publisher is trustworthy, and if an attacker controls the download page they can change both the file and the checksum. That's why some projects also sign their checksum files digitally.
Why MD5 and SHA-1 are no longer trusted
MD5 was once everywhere, but researchers showed long ago how to create two different files with the same MD5 hash. The CERT Coordination Center's vulnerability note says MD5 "should be considered cryptographically broken and unsuitable for further use".
SHA-1 followed. In February 2017, researchers from CWI Amsterdam and Google published SHAttered: two visibly different PDF files with an identical SHA-1 hash. NIST has since announced that SHA-1 should be retired by 31 December 2030, in favour of SHA-2 (the family that includes SHA-256) or SHA-3.
Both still catch accidental damage, such as a download that was cut short. What they can't do is stop someone deliberately crafting a file that matches. If a publisher offers SHA-256, use it. Our tool includes SHA-1 only because some older systems still publish SHA-1 checksums.
Hashing is not encryption
Encryption is two-way: with the right key, you get the original data back. Hashing is one-way and uses no key, so there is nothing to "decrypt". Websites that claim to reverse SHA-256 are really looking up hashes of common inputs they have already calculated. That works for "hello" and "password123", but not for a random file.
The lookup trick is exactly why a fast hash such as SHA-256 is the wrong tool for storing passwords: an attacker with a leaked database can try billions of guesses quickly. Proper password storage uses slow, salted algorithms built for the job. The OWASP Password Storage Cheat Sheet recommends Argon2id first, then scrypt, with bcrypt for older systems and PBKDF2 where FIPS-140 compliance is required. Our Hash Generator is for checksums and verification, never for storing passwords. Base64 isn't encryption either, as our guide to Base64 and JWTs explains.
Using the SAA Tool Hash Generator
The Hash Generator calculates SHA-1, SHA-256, SHA-384 and SHA-512 with your browser's built-in Web Crypto API. Nothing is uploaded.
- Choose the algorithm. SHA-256 is selected by default.
- Type or paste your text, or choose a file.
- Click Generate Hash and compare the result with the published value.
Text is hashed exactly as entered, so a trailing space or line break changes the result. This often confuses people comparing with the command line: echo hello | sha256sum hashes "hello" plus a newline and gives 5891b5b5…, while our tool gives 2cf24dba… for "hello". Run printf 'hello' | sha256sum instead to get a match.
The browser reads the whole file into memory before hashing, so very large files, such as multi-gigabyte disk images, can be slow or fail on phones. For those, use the built-in commands above. There is no MD5 option.
Frequently asked questions
Can a SHA-256 hash be reversed?
No. It can only be guessed, by hashing candidate inputs until one matches. For a long random input, that isn't feasible.
Is SHA-256 still safe to use in 2026?
Yes. No practical collision attack on SHA-256 is known, and NIST recommends the SHA-2 family that it belongs to.
Why doesn't my hash match the one on the website?
The usual causes are a different algorithm (check the length), an incomplete download, a different edition of the file (for example the x64 installer instead of ARM64), or extra spaces and line breaks when hashing text.
Is a checksum the same thing as a hash?
On download pages, usually yes: "checksum" there means a SHA-256 or similar hash. Strictly, checksum is a wider term that also covers simple error-detecting codes such as CRC32, which catch accidental errors but give no protection against deliberate tampering.