Hash Generator: MD5, SHA-1, SHA-256 & SHA-512

Type text or drop in a file and see its MD5, SHA-1, SHA-256, SHA-384 and SHA-512 hashes update together. Add a secret key for HMAC, or paste a published checksum to verify a download.

Loading Hash Generator: MD5, SHA-1, SHA-256 & SHA-512…

How to Use Hash Generator

1

Enter text or choose a file

Type or paste text and the hashes update as you type, or use Hash a file to compute checksums of a download.

2

Read every algorithm at once

MD5, SHA-1, SHA-256, SHA-384 and SHA-512 are shown side by side, so you can copy whichever one you need. Switch to uppercase if the value you compare against uses capital letters.

3

Compare against an expected checksum

Paste the hash published on a download page and the tool tells you whether it matches.

4

Add a key for HMAC

Turn on HMAC with a secret key to sign the input with HMAC-SHA. This is how webhook signatures from services such as GitHub and Stripe are computed.

Hash Generator Guide

What a hash function does

A cryptographic hash turns any input into a fixed-length fingerprint. The same input always gives the same digest, a one-character change gives a completely different one, and there is no practical way to work backwards from the digest to the input. SHA-256 produces 64 hexadecimal characters, SHA-512 produces 128, SHA-1 produces 40, and MD5 produces 32.

Text is hashed as UTF-8 bytes, which matches sha256sum, openssl dgst and the hashing functions in most languages. Watch for invisible differences such as a trailing newline: echo "abc" | sha256sum hashes "abc\n", not "abc".

Which algorithm to choose

Use SHA-256 for new work: file integrity checks, cache keys, content addressing, signing inputs and API request signatures. SHA-512 is equally safe and can be faster on 64-bit hardware. MD5 and SHA-1 are broken for security purposes, since attackers can create two different inputs with the same digest, but they are still common for non-security checksums and in older systems.

Hashes are not for storing passwords

Plain SHA-256 is designed to be fast, which is exactly wrong for passwords: an attacker with a leaked database can try billions of guesses per second. Store passwords with a slow, salted algorithm built for the job, such as Argon2id, scrypt or bcrypt.

Frequently Asked Questions

Can a hash be reversed to get the original text?

No. A hash function is one-way. For short or common inputs, attackers use precomputed tables of known hashes to find a match, which is why plain hashes of passwords are unsafe. For long, unique inputs such as files, reversing a hash is not practical.

Why does my hash differ from the one my code produces?

The input bytes are almost always different. Common causes are a trailing newline added by echo or a text editor, Windows line endings, a different text encoding, or hashing a hex string instead of the raw bytes. Hash functions change completely when a single byte changes.

Is MD5 still safe to use?

MD5 and SHA-1 are fine for spotting accidental corruption, such as checking a download completed correctly. They are broken for security purposes, because attackers can create two different inputs with the same hash. Use SHA-256 or stronger for signatures and integrity checks that must resist tampering.

What is the difference between a hash and an HMAC?

A hash depends only on the input, so anyone can compute it. An HMAC also depends on a secret key, so only someone who knows the key can produce the right value. That is what lets a server prove a webhook really came from the service that holds the shared secret.

More in Developer Utilities