Hash generator
Make the MD5, SHA-1 and SHA-256 hash of any text or file, check a download against its checksum, and encode or decode Base64 and hex. Everything runs on your device; nothing is uploaded.
Choose a file to see its hashes.
Try it: change one letter of the text and watch every hash change completely. That is the avalanche effect, and it is why a hash works as a tamper check.
Base64 and hex: encode and decode
Type in any box; the other two follow. No key is involved, which is the point: anyone can reverse an encoding.
Short answer: encoding changes how data is written so it can travel, and anyone can reverse it (Base64, hex). Encryption hides data with a key, and only the right key reverses it (AES, RSA). Hashing makes a fixed-length fingerprint that is not meant to be reversed (SHA-256). Encode to move data, encrypt to keep it secret, hash to prove it has not changed.
Hashing vs encryption vs encoding
| Encoding | Encryption | Hashing | |
|---|---|---|---|
| Purpose | Carry data in a form another system accepts | Keep data secret (confidentiality) | Detect any change (integrity) |
| Uses a key? | No | Yes | No |
| Reversible? | Yes, by anyone | Yes, with the key | No; it is one-way |
| Output size | Grows with the input | Grows with the input | Always the same length |
| Examples | Base64, hex, URL encoding, ASCII | AES, RSA, ChaCha20 | SHA-256, SHA-3, and the older MD5 and SHA-1 |
| Common use | Email attachments, data inside URLs and JSON | HTTPS, disk encryption, VPNs | File checksums, digital signatures, stored passwords (with a salt) |
A quick test for any exam question: ask "is there a key?" and "can it be undone?" No key and anyone can undo it: encoding. A key, and the key undoes it: encryption. No key and it cannot be undone: hashing.
The three hashes on this page
| Hash | Length | Status |
|---|---|---|
| MD5 | 128 bits (32 hex characters) | Broken for security: practical collisions since 2004. Still seen as a checksum against accidental corruption. |
| SHA-1 | 160 bits (40 hex characters) | Broken for security: first public collision in 2017. NIST says to phase it out by the end of 2030. |
| SHA-256 | 256 bits (64 hex characters) | Current. Part of the SHA-2 family; no practical attacks are known. The usual choice for checksums and signatures today. |
A collision is two different inputs that give the same hash. Once collisions are practical, an attacker can prepare a harmless file and a harmful one that share a hash, so a signature on one also fits the other. That is why MD5 and SHA-1 are retired from signatures and certificates even though they still "work".
Salting and key stretching
Fast hashes are the wrong tool for storing passwords, because an attacker who steals the database can try billions of guesses. Two defences appear by name in the Security+ objectives:
- Salting adds a random value, different for every user, to each password before hashing. Two people with the same password get different hashes, and precomputed "rainbow tables" stop working.
- Key stretching runs the hash thousands of times or more so that every guess is slow. PBKDF2, bcrypt and Argon2 are built for this.
Hashing also sits inside a digital signature: the sender hashes the message and encrypts that hash with a private key, and anyone with the public key can check both who sent it and that it has not changed.
More free Security+ study pages: the 20-question practice test, the ports and protocols chart, the acronym list, the PBQ practice labs and the five exam domains (hashing is in Domain 1).
Questions people ask
What is the difference between hashing, encryption and encoding?
Encoding changes how data is written so another system can carry it; anyone can reverse it and there is no key (Base64, hex). Encryption hides data with a key and is reversed only with the right key (AES, RSA). Hashing turns any input into a fixed-length fingerprint and is not meant to be reversed at all (SHA-256). Use encoding to move data, encryption to keep it secret and hashing to check that it has not changed.
Is Base64 encryption?
No. Base64 is encoding. It has no key, and anyone can decode it in a second, as the decoder on this page shows. Base64 text looks scrambled, but it protects nothing.
Can a hash be reversed or decrypted?
Not by running the math backwards: a hash throws information away, so there is nothing to decrypt. Short or common inputs can still be found by guessing, hashing each guess and comparing, which is why password databases add a salt and use a slow, key-stretching algorithm rather than one fast hash.
Is MD5 still safe to use?
Not for security. Researchers showed practical MD5 collisions (two different inputs with the same hash) in 2004, so MD5 must not be used for signatures, certificates or passwords. It is still seen as a quick checksum against accidental corruption, where nobody is trying to cheat.
Is SHA-1 still safe to use?
No, for the same reason. The first public SHA-1 collision was published in 2017, and NIST has said SHA-1 should be phased out by the end of 2030. Use SHA-256 or another member of the SHA-2 or SHA-3 families.
How do I check a download against its checksum?
Choose the downloaded file under Hash a file, then paste the checksum the publisher lists into the Compare box. The page tells you which hash it matches, or that it does not match. A match shows the file arrived unchanged; it proves who made it only if you got the checksum from a source you trust.
Is anything I type or choose uploaded?
No. The hashing and encoding run in JavaScript on your own device. The text and files never leave your browser, and the page works offline once it has loaded. Even so, do not paste real passwords into any website.
Is hashing on the Security+ exam?
Yes. Objective 1.4 of the published CompTIA Security+ SY0-701 objectives, on cryptographic solutions, lists hashing, salting, key stretching, digital signatures and obfuscation by name. This page is an independent study aid and is not affiliated with CompTIA.
Put this tool on your own website
Class page, blog or study group site: paste the snippet below and the hash generator appears on your page, free, with no sign-up. Add ?theme=light to the iframe address for a light version.
This page is an independent study aid from D M Breault, Inc. It is not affiliated with or endorsed by CompTIA. CompTIA and Security+ are trademarks of CompTIA, Inc., used here only to name the exam. Sources: RFC 1321 (MD5), NIST FIPS 180-4 (SHA-1, SHA-256), RFC 4648 (Base64), NIST's 2022 announcement retiring SHA-1, and the published SY0-701 exam objectives.