Security 7 min read
You have probably seen a long string of letters and numbers next to a download button, labeled "SHA-256" or "MD5". That string is a hash, and it is one of the most useful ideas in computing: a tiny fingerprint that lets you check whether data has changed.
In this guide you will learn what a hash is, which properties make it useful, how MD5, SHA-1 and SHA-256 compare, what hashes are used for and how to verify a downloaded file step by step.
Generate a hash now MD5, SHA-1, SHA-256, SHA-512 and more, calculated in your browser. Your text and files are never uploaded. Open the hash generatorWhat is a hash?
A hash is the result of a hash function: a mathematical process that takes any input (a word, a document, a movie, a whole disk) and turns it into a fixed-size string of characters. It is usually written in hexadecimal, for example 64 characters for SHA-256.
Think of it as a fingerprint. A fingerprint is small, identifies a person and does not let you rebuild the person. In the same way, a hash identifies a piece of data without containing it.
The key properties of a hash function
A good cryptographic hash function has these properties:
- Deterministic: the same input always produces exactly the same hash.
- Fixed size: a one-letter text and a 10 GB file both produce a hash of the same length.
- One-way: you can compute the hash from the data, but you cannot practically get the data back from the hash.
- Avalanche effect: changing a single character or bit changes the result completely, so similar inputs do not give similar hashes.
- Collision resistance: it should be practically impossible to find two different inputs with the same hash.
A collision happens when two different inputs produce the same hash. They always exist in theory, because there are more possible inputs than hashes. A secure algorithm makes finding one unrealistic.
Common algorithms: MD5, SHA-1, SHA-256 and SHA-512
MD5 (128 bits, 32 hex characters) is fast and still everywhere, but practical collision attacks have been known for many years. It is broken for security. Use it only for non-security tasks, such as spotting accidental corruption or as a quick file identifier.
SHA-1 (160 bits, 40 hex characters) was also broken: researchers produced a real collision in 2017 and it has been phased out of certificates and signatures. Avoid it for anything security related.
SHA-256 and SHA-512 belong to the SHA-2 family (256 and 512 bits, 64 and 128 hex characters). They are the current standard and no practical attack is known. SHA-256 is the usual default for checksums, signatures and blockchains. SHA-3 is a newer, different design that is also considered secure.
What hashes are used for
- Verifying downloads: publishers list the hash of a file so you can confirm that what you got is exactly what they published, with no corruption or tampering.
- Password storage: websites should store a hash of your password, not the password itself (see the next section for how to do it right).
- Deduplication: storage and backup systems compare hashes to detect identical files without comparing them byte by byte.
- Digital signatures and certificates: instead of signing a whole document, software signs its hash, which is faster and just as binding.
- Version control and blockchains: tools such as Git identify content by hash, and each blockchain block references the hash of the previous one.
Hash vs encryption vs encoding
These three are often confused, but they solve different problems:
- Hashing is one-way and has no key. Its goal is to verify, not to hide. You cannot "decrypt" a hash.
- Encryption is two-way: with the right key you turn readable data into unreadable data and back. Its goal is confidentiality.
- Encoding, such as Base64, is just a change of format that anyone can reverse. It offers no security at all.
If you need to read the data again later, you want encryption or encoding, not a hash.
Passwords: use salted, slow hashes, not plain SHA-256
Hashing is the right way to store passwords, but the algorithm matters. SHA-256 and MD5 are designed to be fast, which helps attackers: with a stolen database they can test billions of guesses per second, and identical passwords produce identical hashes.
Password storage should use a purpose-built algorithm such as Argon2, bcrypt or scrypt. They add a unique random salt to each password (so equal passwords get different hashes) and are deliberately slow and costly to compute, which makes mass guessing impractical.
As a user, this is one more reason to pick long, unique passwords, since even a good hash cannot rescue a weak one. Our password generator can create them for you.
How to verify a downloaded file in 4 steps
- On the official download page, find the published checksum (usually SHA-256) and copy it. Make sure the page is the publisher's own, ideally over HTTPS.
- Open the hash generator, choose the same algorithm (for example SHA-256) and select the file you downloaded. It is processed locally in your browser.
- Compare the generated hash with the published one. Ignore upper or lower case, but every character must match.
- If they match, the file is intact. If they differ, delete it and download again from the official source: it may be corrupted or tampered with.
Common mistakes to avoid
- Using MD5 or SHA-1 to protect anything that matters. Prefer SHA-256 or stronger.
- Storing passwords as plain SHA-256 or MD5 without a salt. Use Argon2 or bcrypt instead.
- Calling a hash "encryption". It cannot be decrypted, and "reversing" one usually just means guessing the original from a list.
- Trusting a hash that comes from the same place as a possibly tampered file. Take it from the official site, ideally over a different channel.
- Comparing only the first few characters. Compare the whole string, or paste both into a comparison field.
- Hashing a text with a hidden space or line break at the end: it produces a completely different result.
Conclusion
A hash is a fixed-size fingerprint: the same data always gives the same result, and any change gives a different one. Use SHA-256 or stronger to verify files, keep MD5 and SHA-1 for non-security uses only, and store passwords with salted, slow algorithms like Argon2 or bcrypt. Whenever you download something important, a quick hash check takes less than a minute.
Frequently asked questions
Can a hash be reversed or decrypted?
No. A hash function is one-way. Websites that "crack" hashes just look them up in huge tables of known words and passwords, so weak or common passwords are found quickly while long random ones are not.
Is MD5 still safe to use?
Not for security. Collisions can be created on purpose, so an attacker could craft a malicious file with the same MD5 as a safe one. It is fine for detecting accidental corruption or as a quick identifier.
What is the difference between SHA-256 and SHA-512?
Both are secure members of the SHA-2 family. SHA-512 produces a longer hash (128 hex characters instead of 64) and can be faster on some 64-bit processors. For checksums, SHA-256 is the common choice.
Why does a tiny change give a completely different hash?
It is called the avalanche effect and it is intentional. Hash functions mix the input so thoroughly that changing one bit alters about half of the output bits, which makes any modification easy to detect.
Is it safe to hash a file in an online tool?
It is safe when the tool works in your browser and does not upload anything. Our hash generator calculates everything locally on your device, so your text and files never leave it.
Free tools mentioned in this article
Keep reading
- How to Create a Strong PasswordLength, randomness and uniqueness: the simple rules that actually protect your accounts, and how to follow them without memorizing a thing.
- The Pomodoro Technique: Complete GuideWork in focused 25-minute blocks with short breaks. Learn how the method works, how to start today and how to adapt it to your routine.
- What Are Roman Numerals? Rules and ConversionSeven letters, a few simple rules and no zero: learn how to read and write Roman numerals, with step-by-step examples like 1994 = MCMXCIV.