# Hash Generator (MD5, SHA)

> Generate MD5, SHA-1, SHA-256, SHA-384 and SHA-512 hashes of text or files, make HMACs with a key, and check a download's checksum. Free, in your browser.

Canonical: https://cromagnon.app/tools/hash-generator
Last updated: 2026-10-26

- Category: Developer
- Formats: TEXT
- Use it: https://cromagnon.app/tools/hash-generator (free, runs in the browser)

## What it does

Create MD5, SHA-1, SHA-256, SHA-384 and SHA-512 hashes of any text or file, all at once. Add a secret key to get HMAC signatures, choose hex or Base64 output, and paste an expected checksum to check that a download is complete and untouched. Files are read on your device and never uploaded.

## How to use it

1. Type or paste text, or press Choose a file to hash a download or document.
2. All five hashes appear; pick hex, HEX or Base64 output.
3. For an HMAC, type the secret key; every hash becomes HMAC-MD5, HMAC-SHA-256 and so on.
4. To verify a file, paste the checksum from the download page into Compare; the tool says which hash matches.

Tip: Text is hashed exactly as typed, in UTF-8, with line breaks as a single newline character. A trailing space or line break changes the whole hash, so trim the text if your hash doesn't match.

## Which hash should you use?

- **SHA-256**: The standard choice for checksums, signatures, Git-style IDs and blockchains. 64 hex characters.
- **SHA-512 and SHA-384**: Longer versions of SHA-2. SHA-512 can be faster on 64-bit computers.
- **SHA-1**: 40 characters. Broken for security since 2017 (two different files with the same hash were made); still seen in old systems.
- **MD5**: 32 characters. Broken for security, but still common for file checksums and cache keys where nobody is attacking.

## What a hash is, and what it isn't

A hash function turns any amount of data into a short fixed-length fingerprint. The same input always gives the same hash, changing a single character changes the hash completely, and you can't work backwards from the hash to the input.

Hashing isn't encryption: there is no key to get the text back. And plain hashes are the wrong tool for passwords, because attackers can try billions of guesses per second. Store passwords with a slow password hash such as Argon2id, bcrypt or scrypt, which your framework provides.

## How to verify a downloaded file

- **1. Find the checksum**: Download pages often list a SHA-256 (sometimes MD5) next to the file, or in a .sha256 file.
- **2. Hash your copy**: Press Choose a file and pick the downloaded file.
- **3. Compare**: Paste the published checksum into Compare. A match means the file is complete and unchanged.
- **On the command line**: Windows: certutil -hashfile file.zip SHA256. macOS: shasum -a 256 file.zip. Linux: sha256sum file.zip.

## HMAC: hashes with a secret key

An HMAC mixes a secret key into the hash, so only someone with the key can produce the same value. Payment providers and webhooks (Stripe, GitHub, Shopify) sign each message with HMAC-SHA-256; your server recomputes it with the shared secret and compares. Type the key to see the HMAC of your text, which is handy for checking a webhook signature by hand. Some services send the signature in Base64 instead of hex; switch the output to match.

## Hash lengths at a glance

The length tells you which algorithm made a hash you found: a 64-character hex string is almost certainly SHA-256. Paste it into Compare and the tool finds the match for you.

- **MD5**: 128 bits: 32 hex characters or 24 in Base64.
- **SHA-1**: 160 bits: 40 hex characters.
- **SHA-256**: 256 bits: 64 hex characters or 44 in Base64.
- **SHA-384**: 384 bits: 96 hex characters.
- **SHA-512**: 512 bits: 128 hex characters.

## Common uses for hashes

- **Download checks**: Confirm a file arrived complete and wasn't changed on the way.
- **Finding duplicates**: Two files with the same SHA-256 are the same file, even with different names.
- **Cache busting**: A short hash of a file's contents in its name (app.3f9a1c.js) changes only when the file changes.
- **Webhook signatures**: Check HMAC-SHA-256 signatures from payment and code-hosting services.
- **Gravatar and IDs**: Some services build IDs from the hash of an email address or a piece of text.

## Hashes in code

JavaScript in the browser: crypto.subtle.digest('SHA-256', new TextEncoder().encode(text)). Node.js: require('crypto').createHash('sha256').update(text).digest('hex'). Python: hashlib.sha256(text.encode()).hexdigest(). PHP: hash('sha256', $text). Each gives exactly the same result as this tool for the same UTF-8 text.

## Tips

- **Same hash as the terminal**: echo adds a newline: use echo -n "text" | sha256sum to get the same hash as this tool.
- **Line endings matter**: A file saved with Windows line endings (CRLF) hashes differently from the same text with LF.
- **Case doesn't matter**: Hex hashes are the same in upper or lower case; Compare accepts either.
- **Paste whole lines**: Compare also understands checksum lines like “SHA256: …” or “… file.zip”.

## Questions

### Can a hash be reversed or decrypted?

No. A hash is one-way. Short or common inputs can be found by guessing (lookup tables), which is why passwords need a slow, salted password hash.

### Is MD5 safe to use?

Not for security: collisions can be made on purpose. It's fine for spotting accidental changes, such as checking a download from a site you trust.

### Why does my hash differ from another tool's?

Usually an extra space or newline, a different text encoding, or different line endings. Hashes of the same bytes are always identical.

### How big a file can I hash?

As big as your device's memory allows; files of hundreds of megabytes work in modern browsers. Nothing is uploaded, so it's fast even on slow connections.

### What is SHA-256 used for?

File checksums, digital signatures and certificates, Bitcoin, Git's newer object format and API signatures (HMAC-SHA-256).

### Is SHA-256 the same as SHA-2?

SHA-256 is one member of the SHA-2 family, alongside SHA-224, SHA-384 and SHA-512. SHA-3 is a separate, newer design.

### Can two files have the same hash?

In theory yes, but for SHA-256 it has never been found and is not practical to make. For MD5 and SHA-1, collisions can be made on purpose.

### Why do I need hex and Base64?

Both write the same bytes. Hex is used by most checksums and command-line tools; Base64 is shorter and is often used in HTTP headers and webhook signatures.

### Is anything I type uploaded?

No. The tool runs in your browser; what you type, paste or open never leaves your device and nothing is stored on a server.

## Related

- [Password Generator](https://cromagnon.app/tools/password-generator)
- [Base64 Encoder & Decoder](https://cromagnon.app/tools/base64)
- [UUID Generator](https://cromagnon.app/tools/uuid-generator)
- [JWT Decoder](https://cromagnon.app/tools/jwt-decoder)
- [All tools](https://cromagnon.app/tools)
