Hash Generator

By Asira Tools Team · Last updated 20 November 2026

Compute the MD5, SHA-1, or SHA-256 hash of any text instantly, using pure JavaScript in your browser — nothing is sent to a server.

Advertisement

Hash Generator

2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824
AlgorithmSHA-256
Digest size256 bits
Hex length64 characters

Hashes are computed locally with pure JavaScript implementations of MD5, SHA-1, and SHA-256. Your text never leaves your browser.

Digest sizes:

MD5 = 128 bits (32 hex characters)  |  SHA-1 = 160 bits (40 hex characters)  |  SHA-256 = 256 bits (64 hex characters)

What Is a Hash?

A hash is a fixed-size fingerprint of a piece of data. Feed any text into a hash function and it produces a short string of hexadecimal characters, called a digest, that represents that exact input. The same input always produces the same digest, but changing even one character produces a completely different digest. The digest is always the same length no matter how long the input is: a one-letter input and a whole novel both produce a 64-character SHA-256 hash. And the process only works one way: given a hash, there is no practical way to work backwards to the original text.

Those three properties, determinism, fixed length, and one-wayness, are what make hashes so useful. You can store a hash instead of the original data, compare two files by comparing their hashes, or verify that a download arrived intact by checking that its hash matches the one the publisher listed. If a single byte changes anywhere in the data, the hash changes dramatically, which is called the avalanche effect: changing "hello" to "hellp" flips about half the bits in the resulting digest.

How to Use This Generator

Type or paste your text into the box and choose an algorithm: MD5, SHA-1, or SHA-256. The hash updates as you type, so you can watch the avalanche effect live by changing one letter and seeing the whole digest change. The result shows the algorithm, the digest size in bits, and the length of the hex string. Use the Copy hash button to copy the digest to your clipboard.

Everything runs locally in your browser using pure JavaScript implementations of the three algorithms. Your text is never sent to a server, which matters when you are hashing passwords, API keys, or other sensitive strings. The hashes this tool produces are identical to the ones produced by command-line tools such as sha256sum, by Python's hashlib, and by every other correct implementation, because all of them follow the same published specifications.

MD5, SHA-1, and SHA-256 Compared

MD5 is the oldest of the three. It was designed by Ron Rivest in 1992 and produces a 128-bit digest, written as 32 hex characters. It is fast and still widely used for non-security checksums, such as spotting accidental file corruption, but it is broken for security purposes: researchers demonstrated practical collisions in 2004, meaning two different inputs can be crafted to produce the same MD5 hash. Never use MD5 where an attacker could benefit from a collision.

SHA-1 was designed by the NSA and published by NIST in 1995. It produces a 160-bit digest, written as 40 hex characters, and it powered Git version control and TLS certificates for years. It too is now broken for security use: in February 2017, Google and CWI Amsterdam published the SHAttered attack, the first practical SHA-1 collision, produced with about 9 quintillion hash computations. Browsers have since stopped accepting SHA-1 certificates, and Git is migrating to SHA-256.

SHA-256 is part of the SHA-2 family published by NIST in 2001. It produces a 256-bit digest, written as 64 hex characters, and it has no known practical collision or preimage attack. It is the current standard for file verification, digital signatures, and blockchain systems: Bitcoin, for example, hashes each block header twice with SHA-256. Unless you have a specific reason to match an older system that uses MD5 or SHA-1, SHA-256 is the right choice, and it is the default in this tool.

What Hashes Are Used For

The most common everyday use is verifying downloads. Software publishers list the SHA-256 hash of each release file next to the download link. After downloading, you hash the file yourself and compare: if the hashes match, the file arrived exactly as published; if they differ, the download is corrupt or has been tampered with. Package managers, app stores, and Linux distributions all rely on this check, and it is the reason knowing how to compare hashes is a basic skill for anyone who downloads software.

Hashes also identify content. Git names every commit by the hash of its contents, so the same content always gets the same name and any change produces a new name. Content-addressed storage systems, deduplication tools, and caches use the same idea: the hash is the address, and two copies of the same data collapse into one. Databases and APIs use hashes to detect changed records without comparing whole documents, and digital signatures hash a document first and then sign the short digest rather than the whole file.

Password storage is a special case that deserves a warning. Passwords should be stored as hashes, never in plain text, but a plain fast hash such as SHA-256 is the wrong tool for the job: it is so fast that an attacker with a stolen database can try billions of guesses per second. Real password storage uses a slow, salted password hash such as bcrypt, scrypt, or Argon2, which are deliberately expensive to compute. This generator is for checksums and general hashing, not for building a login system.

Worked Example: Hashing the Same Text Three Ways

Hashing the word "hello" shows how the three algorithms differ. MD5 gives 5d41402abc4b2a76b9719d911017c592, which is 32 hex characters. SHA-1 gives aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d, which is 40 hex characters. SHA-256 gives 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824, which is 64 hex characters. All three are deterministic: hashing "hello" again anywhere in the world gives exactly the same three digests.

The empty string is a useful test vector because it has a well-known hash for every algorithm. The SHA-256 hash of nothing at all is e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855, and the MD5 hash of the empty string is d41d8cd98f00b204e9800998ecf8427e. These values are published in the algorithm specifications and in test suites everywhere, and you can use them to check that any hash tool is working correctly. Try clearing the input box in this tool and confirming that the SHA-256 output matches the value above.

Tips and Common Mistakes

Watch out for invisible characters. A trailing space or a newline at the end of your text is part of the input, and it changes the hash completely. If your hash does not match the one you expected, the most common cause is an extra newline, especially when copying text from a terminal or a file. The string "hello" and the string "hello" followed by a newline have entirely different hashes.

Case matters. "Hello" and "hello" hash to different values, because the hash function sees different bytes. The same goes for encoding: this tool hashes the UTF-8 bytes of your text, which is the standard. If another tool uses a different encoding, the hashes will disagree on non-English characters even when the visible text is identical.

Do not compare hashes by eye. Two digests that look similar at a glance can differ in the middle. Copy both values and compare them with a tool, or at least compare the first and last eight characters as well as the length. A hash that is the right length but differs in one digit means the inputs were different.

Do not use MD5 or SHA-1 for security. Both are fine for detecting accidental corruption, but both have practical collision attacks. For anything where an attacker might try to forge a matching hash, use SHA-256 or a newer algorithm from the SHA-2 or SHA-3 families.

Remember that hashing is not encryption. A hash cannot be decrypted, but it also cannot hide short, guessable inputs: an attacker can hash a dictionary of common passwords and compare. That is why password systems add a random salt and use slow hashes, and why you should never publish the hash of a short secret and assume it is safe.

Advertisement

Frequently Asked Questions

What is the SHA-256 hash of an empty string?

e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855. It is a standard test vector published in the SHA-256 specification, and you can verify it by clearing the input box in this tool.

Which hash algorithm should I use, MD5, SHA-1, or SHA-256?

Use SHA-256 for anything security-related: it produces a 256-bit digest and has no known practical collision attack. MD5 and SHA-1 are both broken for security use and should only be used for non-security checksums or to match an older system.

Can a hash be reversed to get the original text?

No. Hash functions are one-way: there is no practical way to compute the input from the digest. Attackers can only guess inputs, hash them, and compare, which is why short or common inputs should never be protected by a plain hash alone.

Why does my hash not match the one from another tool?

The most common causes are an extra trailing space or newline in the input, a case difference, or a different text encoding. This tool hashes the UTF-8 bytes of exactly the text in the box, with nothing added, which matches command-line tools like sha256sum.

Is it safe to hash passwords with this tool?

This tool is safe to use because nothing leaves your browser, but plain MD5, SHA-1, or SHA-256 hashes are not a safe way to store passwords. Password storage needs a slow, salted password hash such as bcrypt, scrypt, or Argon2, which are designed to resist guessing attacks.