Hash Generator

MD5—
SHA-1—
Input length (chars)—

How Hash Generator is calculated: MD5 (128-bit), SHA-1 (160-bit), SHA-256 (256-bit) and SHA-512 (512-bit) digests of your text, computed with CryptoJS 4.2.0 (MIT licence) in your browser. Hashes are one-way: the original text cannot be recovered from the digest.

What is a hash generator?

A hash generator takes any text and turns it into a fixed-length string of letters and numbers called a digest. The same text always produces the same digest, and even a tiny change in the text produces a completely different one. Type hello and you get the same result every time; type Hello with a capital H and the result is unrecognisable. That one-way, deterministic behaviour is what makes hashes useful.

This tool produces four digests at once. MD5 gives a 32-character digest, SHA-1 gives 40 characters, SHA-256 gives 64, and SHA-512 gives 128. The default input is the word hello, and its digests are the best-known examples in computing: MD5 5d41402abc4b2a76b9719d911017c592, and SHA-256 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824. You can check those values against any other hash tool — they are the same everywhere, because the algorithms are standard.

Hashes are used for two jobs above all others: checking that a file has not changed, and storing passwords safely. A download page publishes the hash of its file, and you hash the file you downloaded; if the two match, the file arrived intact. A website stores the hash of your password rather than the password itself, so a stolen database does not hand out everyone's passwords.

The hashes here are computed with CryptoJS version 4.2.0, a widely used open-source library released under the MIT licence, loaded from a copy stored on this site. The library runs in your browser, and the page also carries built-in fallbacks that produce identical results, so the digests are correct whether the library loads or not. The attribution is part of the honest accounting for the tool.

How this hash generator works

Type text into the box and the four digests update instantly. The text is first converted to bytes using UTF-8, the standard encoding for web text, so words in any script — Hindi, Arabic, Chinese, emoji — hash consistently. Then each algorithm processes those bytes and produces its digest, shown in lower-case hexadecimal: the characters 0 to 9 and a to f.

MD5 works in 512-bit blocks with four rounds of mixing per block, and produces a 128-bit digest — 32 hex characters. It is fast and widely supported, which is why it is still used for checksums, but it is broken for security: two different inputs can be crafted to produce the same MD5 digest, so it must never be used to protect passwords or to prove a file is genuine.

SHA-1 works similarly and produces a 160-bit digest — 40 hex characters. It was the standard for years, but it too is broken for security: researchers have produced real collisions, where two different files share the same SHA-1 digest. It remains useful for checksums of non-adversarial data, but nothing that an attacker might want to forge should rely on it.

SHA-256 and SHA-512 are the modern choices. SHA-256 produces a 256-bit digest — 64 hex characters — and SHA-512 a 512-bit digest — 128 hex characters. Neither has any known practical attack, and both are the standard for password storage, file verification, and digital signatures today. If you need one hash and you are unsure which, use SHA-256.

The numbers: lengths, and what changes them

The results show the MD5 digest, the SHA-1 digest, and the length of your input in characters. The full set of four digests, including SHA-256 and SHA-512, is in the output box below, because a 128-character SHA-512 digest is too long for a results row. The input length is shown because the digest length never changes with it: hello (5 characters) and a whole paragraph both produce a 64-character SHA-256 digest.

That fixed length is one of the defining properties of a hash. No matter how long the input — one character or one million — the digest is the same size. The algorithm compresses the input down, which is also why the process cannot be reversed: many different inputs share the same digest length, and the digest simply does not contain enough information to rebuild the original.

The avalanche effect is the other defining property. Change one character of hello — make it hallo — and every digest changes completely, not just a little. There is no partial similarity between the digest of hello and the digest of hallo, and no way to tell from the digests alone that the inputs were almost the same. That is what makes a hash a good fingerprint: any change, however small, is visible.

An empty input has real digests too, and they are well-known values. The MD5 of nothing is d41d8cd98f00b204e9800998ecf8427e, and the SHA-1 of nothing is da39a3ee5e6b4b0d3255bfef95601890afd80709. Try it: delete the text in the box and watch the digests change to those values. A hash of nothing is still a hash, and it is the same on every tool in the world.

A worked example: hashing hello

Start with the default input, the word hello. Its MD5 is 5d41402abc4b2a76b9719d911017c592 — 32 characters. Its SHA-1 is aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d — 40 characters. Its SHA-256 is 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824 — 64 characters. Its SHA-512 is 9b71d224bd62f3785d96d46ad3ea3d73319bfbc2890caadae2dff72519673ca72323c3d99ba5c11d7c7acc6e14b8c5da0c4663475c2e5c3adef46f73bcdec043 — 128 characters.

Those four values are the same on every correct implementation, which is why they make a good check. If any tool gives you a different MD5 for hello, that tool is broken — not this one, and not the standard. The values are used in textbooks and test suites for exactly this reason, and they are the values this page shows.

Change the input to Hello, World! and watch all four digests change completely. The MD5 becomes 65a8e27d8879283831b664bd8b7f0ad4, the SHA-1 becomes 0a0a9f2a6772942557ab5355d76af442f8f65e01, and the SHA-256 becomes dffd6021bb2bd5b0af676290809ec3a53191dd81c7f70a4b28688a362182986f. The input grew from 5 characters to 13, but the digest lengths did not move at all.

Try password123 as a third input. Its SHA-256 is ef92b778bafe771e89245b89ecbc08a44a4e166c06659911881f383d4473e94f. That value appears in password-breach lists, because password123 is one of the most common passwords in the world and its hash is public knowledge. If your password's hash appears in a list like that, change the password — the hash is doing its job by telling you it is already known.

Who generates hashes, and why

Developers hash text when they store passwords. A website should never store your password; it stores the hash, and when you log in it hashes what you typed and compares the two digests. A stolen database then contains hashes, not passwords — and with a slow, salted hash, those hashes are very hard to turn back into passwords. MD5 and SHA-1 are too fast and too broken for this job; modern systems use slow hashes built for the purpose.

Anyone downloading software uses hashes to check the file arrived intact. The download page publishes the SHA-256 of the file, you hash the file you received, and if the two match, the file is whole. A single changed byte — a corrupted download, or a tampered file — produces a completely different digest, so the check catches both accidents and attacks.

Content systems use hashes as fingerprints. A file's hash identifies it more reliably than its name, because two files with the same content have the same hash, and two files with different content almost certainly do not. Deduplication, caching, and version control all rely on that property: change the content and the hash changes, which is how the system knows something is new.

Forums and support teams use hashes to compare sensitive data without sharing it. Two people can compare the hash of a file, a password, or a piece of text and learn whether they match, without either of them revealing the original. That is the point of a one-way function: it proves sameness without exposing the thing itself.

Hash generator vs password storage

A hash generator and a password system are related but not the same thing. This page shows plain, unsalted hashes — the raw digest of the text you typed. Real password storage adds two things this page does not: a salt, a random value mixed in so that two users with the same password get different hashes, and a slow function, so that guessing passwords one by one is expensive. Without those, a plain SHA-256 of a common password is exactly as guessable as the password itself.

That is why the worked example matters. The SHA-256 of password123 is public knowledge, because the password is common and the hash is fast to compute. A salted, slow hash of the same password would be different for every user and slow to test, which is the whole defence. Use this tool to learn what hashes look like and to verify files — not as a password storage system.

For the rest of the toolkit, the companions are nearby: a password generator creates passwords worth hashing, a password strength checker judges how strong they are, a hex encoder covers the hex encoding every digest on this page is shown in, and a Base64 encoder covers the encoding that hashes are often carried in. Together they cover the small, practical pieces of working with text securely.

The library behind this page, CryptoJS 4.2.0, is released under the MIT licence, which permits use, copying, and modification with the licence notice kept. The copy used here is stored on this site, so the page works without reaching out to any external server — the hashing happens in your browser, and your text never leaves it.

Common hash mistakes

The first mistake is using MD5 or SHA-1 for security. Both are broken for collision resistance: researchers have produced two different files with the same MD5 digest, and the same for SHA-1. They are fine for checksums where nobody is trying to forge anything, and dangerous anywhere an attacker benefits from a collision. Use SHA-256 or SHA-512 for anything that matters.

Second: hashing a password without a salt. Two users with the same password get the same digest, which tells an attacker exactly who shares a password, and lets them test guesses against every account at once. Salting — mixing a random value into each hash — is not optional in real systems; it is the difference between a breach and a catastrophe.

Third: assuming a hash is encryption. It is not. Encryption can be reversed with a key; a hash cannot be reversed at all. That one-way property is the point, and it means there is no way to recover the original text from a digest — including your own, if you lose it. Keep the original somewhere safe.

Fourth: comparing hashes with a simple equals check in code, which can leak timing information about how many characters matched. Real systems compare digests in constant time. On this page the comparison is yours to make by eye, which is fine for checking a download — but if you build a login system, use a library that handles the comparison for you.

How to use this hash generator

Type or paste your text into the box at the top. The default word, hello, is already there, with its four digests shown. Replace it with your own text and the digests update instantly as you type — there is no button to press.

Read the MD5 and SHA-1 digests in the results, and all four digests in the output box. Copy whichever you need: SHA-256 is the usual choice for verifying a file, and the output box has the full 64-character value ready to copy. Compare it with the published digest character by character — a single difference means the file is not the one that was published.

Try the edge cases to build confidence: delete the text and watch the empty-input digests appear, then type a single character and watch all four digests change completely. That avalanche effect is the property that makes hashes useful as fingerprints, and seeing it happen is the quickest way to understand it.

Everything runs in your browser. Your text never leaves your device, is never uploaded, and is never stored — which matters, because people hash passwords and private text here. The hashing library is stored on this site, the page makes no network requests for it, and closing the page removes what you typed. Hashes are one-way; a signed token is the next step — our JWT generator builds a header.payload.signature token with HMAC-SHA256 in your browser.

Frequently Asked Questions

5d41402abc4b2a76b9719d911017c592. It is 32 characters long, and it is the same on every correct implementation, which is why it is used in textbooks and test suites. The SHA-256 of hello is 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824, and the SHA-512 is 9b71d224bd62f3785d96d46ad3ea3d73319bfbc2890caadae2dff72519673ca72323c3d99ba5c11d7c7acc6e14b8c5da0c4663475c2e5c3adef46f73bcdec043.

No. Hashing is one-way: the digest does not contain enough information to rebuild the original, and there is no key that reverses it. The only way to find the input is to guess it, hash the guess, and compare — which is why common passwords are unsafe even hashed, and why real systems add a salt and use a slow hash function.

Only for checksums where nobody is trying to forge anything. MD5 is broken for security: two different files can be crafted to share the same MD5 digest, and the same is true of SHA-1. For file verification and anything an attacker might target, use SHA-256 or SHA-512, which have no known practical attack.

CryptoJS version 4.2.0, a widely used open-source library released under the MIT licence, loaded from a copy stored on this site — so the page works without contacting any external server. The page also carries built-in fallback code that produces identical digests, and the two were checked against each other on the same inputs.

More free tools

More calculators and utilities from Sortrun — free, no sign-up.