Quick Answer
A hash generator turns any text or file into a fixed-length string using algorithms like MD5, SHA-1, or SHA-256. The same input always gives the same hash, but you cannot reverse it back to the original. Developers use hashes to verify file integrity, store password checks, and detect changes, though MD5 and SHA-1 are outdated for security.
Hashing is the process of turning any input into a fixed-length fingerprint called a hash, and you need it whenever you want to verify that data has not changed, store passwords safely, or compare information without keeping the original. The same input always produces the same hash, but you can never work backwards from a hash to the original text. That one-way property is what makes hashing so useful across software and security. This guide explains what hashing is, how MD5 and SHA-256 differ, where it is used, and how to generate a hash for free.
What Is Hashing, Exactly?
Hashing runs your input through a mathematical function that outputs a fixed-length string of characters, no matter how large or small the input. Hash the word hello and you get one specific string. Hash an entire book and you get a string of the same length. That consistency is the point.
Two properties make hashing special. First, it is deterministic: the same input always gives the same hash, so you can check whether two things match by comparing their hashes. Second, it is one-way: there is no key or trick that turns a hash back into the original. Change a single character of the input and the hash changes completely, which is why a hash works like a tamper-evident fingerprint.
Here is that effect with real SHA-256 output. The only difference between the two inputs is a capital H:
hellogives2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824Hellogives185f8db32271fe25f561a6fc938b2e264306ec304eda518007d1764826381969
Compare the two bit by bit and 125 of the 256 bits differ, close to the half you would expect from a well-designed hash. Cryptographers call this the avalanche effect. It is also why you cannot "get close" to a target hash by tweaking an input: a near miss in the input tells you nothing about the output.
What Is the Difference Between MD5, SHA-1, and SHA-256?
MD5, SHA-1, and SHA-256 are the three algorithms you will meet most often, and the difference between them comes down to output length and how much security is left in each.
- MD5 produces a 128-bit hash and is very fast. However, it is considered cryptographically broken, because researchers can create two different inputs that produce the same hash, known as a collision. RFC 6151 states that MD5 is no longer acceptable where collision resistance is required, such as digital signatures. Use it only for quick, non-security checks.
- SHA-1 produces a 160-bit hash (40 hex characters). In 2017 the SHAttered project from CWI Amsterdam and Google published two different PDF files with the same SHA-1 hash, the first practical collision. NIST has announced it will stop using SHA-1 in its last remaining specified protocols by December 31, 2030, and recommends that anyone relying on SHA-1 for security move to SHA-2 or SHA-3 as soon as possible.
- SHA-256 produces a longer 256-bit hash and is part of the SHA-2 family. It is currently secure, with no practical collisions known, and is the standard choice for integrity checks, digital signatures, and security work. The SHA-2 family is defined in the FIPS 180-4 standard published by NIST. SHA-512 is its 512-bit sibling (128 hex characters) from the same family.
Rule of thumb: Reach for SHA-256 by default. Only use MD5 when you just need a fast fingerprint for a non-security task, such as detecting whether a file changed in a trusted setting.
Create MD5, SHA-1, SHA-256, and SHA-512 hashes from any text with our free Hash Generator. It runs in your browser, so nothing is uploaded.
Open Hash Generator →When Do You Actually Need Hashing?
Hashing is quietly everywhere in modern software. Here are the use cases that come up most for developers and security-minded users.
Verifying file integrity
When you download software, the provider often publishes a SHA-256 hash of the file. You generate the hash of your downloaded copy and compare it to the published one. If they match, the file arrived intact and untampered. If they differ, the download is corrupted or has been altered, and you should not run it.
Storing passwords safely
Well-built systems never store your actual password. They store a hash of it, combined with a random value called a salt. When you log in, the system hashes what you typed and compares it to the stored hash. Because hashing is one-way, even if the database leaks, the raw passwords are not sitting there in plain text. The catch is that the hash has to come from a deliberately slow password hashing function, not plain SHA-256, as explained below.
Signatures, checksums, and more
Hashing underpins digital signatures, which prove a message came from who it claims and was not changed. It powers the checksums that verify data transfers, and it is fundamental to how blockchains link and secure records. Databases also use hashing to index and compare data quickly without storing the original values. The SHA algorithms and their HMAC construction are also specified with reference code by the IETF.
Paste text into the Hash Generator, switch between algorithms, and watch how one small change rewrites the entire hash. Free and instant.
Open Hash Generator →How Do You Verify a Downloaded File's SHA-256 Checksum?
Say you download an installer and the publisher's release page lists a SHA-256 value next to it. Hash your copy with the command for your system, then compare the two strings.
- Windows (Command Prompt):
certutil -hashfile installer.exe SHA256. Type the algorithm name. If you leave it off, certutil prints a SHA-1 hash instead, which will never match a SHA-256 value. - Windows (PowerShell):
Get-FileHash .\installer.exe. SHA-256 is the default algorithm, and the result appears in the Hash column. - macOS:
shasum -a 256 installer.dmg - Linux:
sha256sum installer.tar.gz. If the publisher ships a checksum file,sha256sum -c SHA256SUMSchecks every listed file and printsOKorFAILEDfor each.
A single differing character means a different file. In PowerShell you can let the computer do the comparison: (Get-FileHash .\installer.exe).Hash -eq "PASTE-PUBLISHED-HASH" returns True or False.
Mistakes that cause false alarms or false comfort
- Trusting a checksum from the same compromised source. If an attacker can swap the download on a website, they can usually edit the checksum on that page too. A match only proves the file matches that page. Where you can, take the hash from a separate channel, such as a signed release announcement, or check the publisher's signature.
- Case differences. Get-FileHash prints uppercase hex, while certutil, shasum, and sha256sum print lowercase.
3CBCand3cbcare the same value. PowerShell's-eqignores case for strings, but a strict text diff will not. - A trailing newline when hashing text. On Linux and macOS,
echo hello | sha256sumhashes "hello" plus a newline and gives a value starting5891b5b5, whileecho -n hello | sha256sumgives the2cf24dbavalue shown above. The same thing happens when you paste text that ends in an extra line break. - Text encoding. A hash works on bytes, not letters. "hello" encoded as UTF-8 hashes to the
2cf24dbavalue, but the same word encoded as UTF-16LE hashes to a value starting06e44dc1. Windows tools that save text as UTF-16 are a common source of "my hash is wrong" reports. - Comparing different algorithms. A 40-character value is SHA-1, 64 characters is SHA-256, 128 is SHA-512. Count before you compare.
Why Should You Not Store Passwords with SHA-256?
SHA-256 was designed to be fast, and fast is the problem. An attacker who steals a database of SHA-256 password hashes can test guesses at enormous speed on graphics cards, and common passwords fall almost immediately. A salt stops precomputed lookup tables and makes identical passwords produce different hashes, but it does not slow down guessing against each individual hash.
Password hashing functions are built to be slow and, in the better cases, memory-hungry. The OWASP Password Storage Cheat Sheet recommends, in order:
- Argon2id with at least 19 MiB of memory, an iteration count of 2, and 1 degree of parallelism.
- scrypt, if Argon2id is not available, with a CPU/memory cost of at least 2^17, a block size of 8, and parallelization of 1.
- bcrypt for legacy systems, with a work factor of 10 or more. Most implementations only accept 72 bytes of password input, so enforce that limit.
- PBKDF2 with HMAC-SHA-256 and at least 600,000 iterations, when you need FIPS-140 compliance.
In practice you call your language's library for one of these and store the string it returns, which usually includes the salt and settings. A browser hash generator, including ours, is the wrong tool for this job. If you need a strong password in the first place, use the password generator.
How Is a Hash Different from HMAC, Encryption, and Encoding?
These four get mixed up constantly. The quickest way to tell them apart is to ask whether a key is involved and whether you can get the original back.
| Operation | Uses a key? | Reversible? | Typical use |
|---|---|---|---|
| Hash (SHA-256) | No | No | Checksums, detecting changes |
| HMAC (HMAC-SHA-256) | Yes, a shared secret | No | Proving a message came from someone holding the key, such as webhook signatures |
| Encryption (AES) | Yes | Yes, with the key | Keeping data secret that you need to read later |
| Encoding (Base64) | No | Yes, by anyone | Moving binary data through text-only channels |
A plain hash cannot prove who sent something, because anyone can recompute it after changing the data. That is the gap HMAC fills. And Base64 offers no protection at all, which you can confirm by decoding any Base64 string in the Base64 tool.
How Do You Use a Hash Generator?
A hash generator makes this practical without any code. Our Hash Generator works on text, and the steps are short.
- Paste or type your text into the input box.
- Click Generate Hashes. MD5, SHA-1, SHA-256, and SHA-512 are all computed at once, so there is no algorithm to pick.
- Read the hash for the algorithm you need.
- Copy it to compare against another hash, or store it as a checksum.
The tool encodes your text as UTF-8 and hashes exactly what is in the box, including spaces and line breaks, so a stray newline at the end will change the result. It does not accept file uploads. To check a downloaded file, use the command line steps above.
To see the fingerprint effect for yourself, hash a sentence, then change one letter and hash it again. The two outputs will look completely unrelated, which is exactly why even a tiny change to a file is easy to detect. Remember that a hash generator is for verification and learning, not for encrypting data you need to read back later.
What Should You Remember About Hashing?
Hashing turns any input into a fixed, one-way fingerprint, and you need it to verify integrity, protect passwords, and compare data safely. Default to SHA-256 for anything that matters, keep MD5 for quick, non-security checks, and move off SHA-1. For passwords, use Argon2id, scrypt, bcrypt, or PBKDF2 rather than any fast hash. When you want to generate or compare a hash of some text, a free browser-based generator does the job in a second, with your data never leaving your device.
Frequently Asked Questions
What is hashing?
Hashing is the process of turning any input, such as text or a file, into a fixed-length string of characters called a hash. The same input always produces the same hash, but you cannot reverse a hash back into the original. It works like a digital fingerprint, so any change to the input produces a completely different hash.
What is the difference between MD5 and SHA-256?
MD5 produces a shorter 128-bit hash and is fast, but it is considered broken for security because different inputs can produce the same hash. SHA-256 produces a longer 256-bit hash and is currently secure and widely used. Use MD5 only for quick, non-security checks, and SHA-256 for anything where integrity or security matters.
What is hashing used for?
Hashing verifies file integrity by comparing checksums, stores passwords safely when combined with salting, powers digital signatures and blockchains, and lets systems compare or index data without storing the original. Developers and security professionals rely on it daily for verification and data protection.
Is a hash the same as encryption?
No. Encryption is two-way: data is scrambled with a key and can be unscrambled with the right key. Hashing is one-way: once text becomes a hash, there is no key that turns it back. Encryption protects data you need to read later, while hashing verifies data without ever needing to reverse it.
Why doesn't my hash match the published checksum?
The most common causes are using a different algorithm (certutil without SHA256 gives SHA-1), hashing text with an extra trailing newline, using a different text encoding such as UTF-16 instead of UTF-8, or a file that really did change in transit. Uppercase and lowercase hex do not matter: they represent the same value.