๐ Hash Generator: SHA-1, SHA-256, and SHA-512 Online
By Shihab Mia ยท Updated 2026-07-25
Hashes update automatically as you type.
MD5 is not offered here: it is cryptographically broken and is not part of the Web Crypto API. Use SHA-256 or stronger for anything security related.
This hash generator turns any text into SHA-1, SHA-256, and SHA-512 hex digests at once, no software or account needed. Type or paste your input and all three hashes appear instantly, each with a one-click copy button. Everything runs in your browser using the built-in Web Crypto API, so your text is never uploaded, logged, or sent to a server. Use SHA-256 as your default for anything security-related, and treat SHA-1 as legacy-only.
What is the Hash Generator?
A cryptographic hash function takes input of any length and produces a fixed-size string of bytes, usually shown as hexadecimal. The same input always produces the same digest, but even a one-character change produces a completely different result, a property called the avalanche effect. Good hash functions are one-way: you cannot feasibly reverse a digest back into the original text, and you cannot easily find two different inputs that share the same digest (a collision). These properties make hashes useful for verifying file integrity, indexing data, fingerprinting content, and storing password verifiers when combined with a salt and a slow algorithm.
This tool covers the SHA family. SHA-1 produces a 160-bit (40 hex character) digest and is now considered broken for security purposes: Google and CWI Amsterdam demonstrated a practical collision attack in 2017 (the "SHAttered" attack), so SHA-1 should only be used for non-security tasks like legacy checksums or systems that still require it, such as older Git commit hashes. SHA-256 and SHA-512 belong to the SHA-2 family and produce 256-bit (64 hex character) and 512-bit (128 hex character) digests respectively. Both are widely trusted and are the right default for new work. SHA-512 is not "more secure for everyone": on 64-bit hardware it can be faster than SHA-256 because it processes data in larger 64-bit words, but SHA-256 remains the more common choice in TLS certificates, code signing, and most protocols.
Hashing shows up across everyday computing in ways most people never notice. SHA-256 is the algorithm behind Bitcoin mining and block hashing, it verifies the checksums Linux distributions and software vendors publish next to download links, and it underpins TLS certificates that make the padlock icon appear in your browser. SHA-1, despite being broken for security, was the object-identifier hash Git used for every commit until the project began migrating to SHA-256 in recent years. Databases and content delivery networks use hashes for deduplication, spotting two files or records that are byte-for-byte identical without comparing them directly. None of this requires the hash to be secret, only unique and tamper-evident.
MD5 is intentionally not offered here. It is cryptographically broken, with trivial, fast collision attacks that make it unsuitable even for many non-security checksums, and it is not part of the Web Crypto API that powers this tool. Some hash generator sites still list MD5 for legacy compatibility with old systems, but for anything new, SHA-256 is a strictly better default at effectively the same cost. This tool also does not offer HMAC (keyed hashing used to verify a message came from someone holding a shared secret) because that needs a secret key input in addition to the message, which is a different workflow from simple text hashing; if you need HMAC-SHA256 for an API signature, look for a dedicated HMAC tool that accepts both a message and a key.
It is worth being precise about what hashing is not. Hashing is not encryption: encryption is reversible with the right key, while a hash has no key and no reverse operation. Hashing is also not the same as encoding schemes like Base64 or URL encoding, which just represent the same data differently and are trivially reversible by design, not intended for security at all. A hash proves that data has not changed since the hash was taken; it says nothing on its own about who created the data unless it is combined with a digital signature. Confusing these three concepts is one of the most common mistakes people make when reading about "hashing a password" or "hashing a file."
This tool hashes text you type or paste, not files. Hashing the same content still produces the same digest either way, since a hash function only cares about bytes, but to verify a downloaded file (an ISO image, an installer, a ZIP archive) you generally need a tool that reads the file directly. On Windows, `certutil -hashfile <path> SHA256` computes a file hash from the command line; on macOS or Linux, `shasum -a 256 <path>` or `sha256sum <path>` does the same. Compare the result against the checksum the publisher listed on their download page to confirm the file was not corrupted or tampered with in transit.
When to use it
- Generating a SHA-256 checksum to verify that a downloaded file, package, or pasted snippet has not been altered.
- Producing a stable, fixed-length key from a longer string for caching, deduplication, or database indexing.
- Comparing a value against an expected hash published by a vendor, release page, or API documentation.
- Learning and testing how hashing works while building, debugging, or teaching a course on an application.
- Creating a content fingerprint to detect whether two pasted blocks of text are byte-for-byte identical.
- Generating a quick, non-secret identifier for logging or tracking a piece of text without storing the text itself.
How to use the Hash Generator
- Type or paste your text into the input box.
- Read the SHA-1, SHA-256, and SHA-512 digests, which update automatically as you type.
- Click the Copy button next to any hash to copy that digest to your clipboard.
- Pick SHA-256 (or SHA-512) for anything security related, and treat SHA-1 as legacy only.
- If you need to verify a downloaded file rather than typed text, use a command-line hash tool (certutil, shasum, or sha256sum) instead, since this page hashes text input only.
Formula & method
Worked examples
Hash the lowercase string abc with SHA-256.
- Encode "abc" as its three UTF-8 bytes: 61 62 63.
- Feed those bytes into the SHA-256 algorithm.
- Read the 64-character hexadecimal digest.
Result: ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad
Hash an empty input (no text) with SHA-1.
- The input is zero bytes long, which is still valid.
- SHA-1 of an empty message is a well-known constant.
- The digest is always the same 40-character value for empty input.
Result: da39a3ee5e6b4b0d3255bfef95601890afd80709
Hash the string abc with SHA-512.
- Encode "abc" as UTF-8 bytes.
- Run SHA-512, which outputs 512 bits.
- The result is 128 hexadecimal characters long.
Result: ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f
SHA algorithm comparison
| Algorithm | Output size | Hex characters | Status |
|---|---|---|---|
| SHA-1 | 160 bits | 40 | Broken, legacy use only |
| SHA-256 | 256 bits | 64 | Recommended, widely used |
| SHA-512 | 512 bits | 128 | Strong, fast on 64-bit CPUs |
| MD5 | 128 bits | 32 | Broken, not offered here |
Known digests of common inputs (UTF-8, SHA-256)
| Input | SHA-256 digest (first 16 hex chars) |
|---|---|
| (empty string) | e3b0c44298fc1c14 |
| abc | ba7816bf8f01cfea |
| Hello, ToolNimba | f05758140f6dc49b |
Where each algorithm shows up in the real world
| Algorithm | Typical real-world use |
|---|---|
| SHA-1 | Older Git commit object IDs, legacy checksums, systems mid-migration to SHA-2 |
| SHA-256 | TLS certificates, code signing, Bitcoin block hashing, software checksums, newer Git objects |
| SHA-512 | Linux password hashing (/etc/shadow), large file integrity checks, some blockchain protocols |
| MD5 | Legacy non-security checksums only; broken for anything requiring collision resistance |
Common mistakes to avoid
- Treating SHA-1 as secure. SHA-1 has practical collision attacks (demonstrated publicly in 2017) and should not be used for signatures, certificates, or password storage. Use SHA-256 or SHA-512 for anything where security matters.
- Expecting hashing to be reversible. A hash is one-way. There is no "decrypt" step. If you need to recover the original value you want encryption, not hashing. Sites that claim to "decode" SHA-256 are just looking it up in a table of precomputed inputs.
- Storing raw password hashes. A plain SHA-256 of a password is too fast and unsalted, so it is weak against brute force. For passwords use a slow, salted algorithm such as bcrypt, scrypt, or Argon2 instead of a bare SHA digest.
- Ignoring encoding differences. This tool hashes the UTF-8 bytes of your text. The same characters encoded as UTF-16, or with a trailing newline added, will produce a different digest. Match the encoding of whatever you are comparing against.
- Comparing hashes with hidden whitespace or case differences. A trailing space, an extra newline, or copying text with different line-ending characters (CRLF vs LF) changes every bit of the hash. Trim and normalize both values before assuming they should match.
- Trying to hash a file by pasting its contents. This tool hashes text input, not raw binary files. Pasting a file into a text box can mangle binary data or change its encoding, producing a digest that does not match the file itself. Use a command-line tool like certutil, shasum, or sha256sum to hash files directly.
Glossary
- Hash function
- An algorithm that maps input of any size to a fixed-size output, designed so the same input always yields the same result.
- Digest
- The fixed-size output of a hash function, often shown as a hexadecimal string.
- SHA-2
- A family of secure hash algorithms that includes SHA-256 and SHA-512, published by NIST and widely used today.
- Collision
- When two different inputs produce the same hash digest. A strong hash function makes finding one infeasible.
- Salt
- A random value added to input (typically a password) before hashing so that identical inputs hash differently.
- Hex (hexadecimal)
- A base-16 number system using 0-9 and a-f. Each hex character represents 4 bits, so two characters represent one byte.
- HMAC
- A keyed hash that combines a message with a secret key, used to prove a message came from someone holding that key. Not the same as plain hashing.
- Avalanche effect
- The property where changing even one character of input flips roughly half the bits in the output digest, making outputs look completely unrelated.
Frequently asked questions
What is a hash generator?
A hash generator turns text into a fixed-length digest using a hash function such as SHA-256. It is used to verify integrity, index data, and build password verifiers. This tool generates SHA-1, SHA-256, and SHA-512 at once.
How do I generate a SHA-256 hash?
Paste your text into the input box above and the SHA-256 digest appears instantly. Click Copy next to it to copy the 64-character hex value. Everything runs in your browser, so nothing is uploaded.
Can a SHA hash be reversed or decrypted?
No. SHA hashes are one-way functions, so there is no way to compute the original input from a digest. So-called hash "decrypters" simply look up the answer in a table of previously seen inputs, which only works for common values.
Is SHA-256 or SHA-512 more secure?
Both are part of the trusted SHA-2 family and are considered secure. SHA-512 has a larger output and can be faster on 64-bit hardware, but SHA-256 is more common in protocols and certificates. For most uses SHA-256 is a fine default.
Why is MD5 not available?
MD5 is cryptographically broken, with fast, practical collision attacks, and it is not included in the browser Web Crypto API that powers this tool. For checksums or security use SHA-256 or stronger instead.
Is my text uploaded anywhere when I hash it?
No. The hashes are computed locally in your browser using the Web Crypto API. Your input never leaves your device and no network request is made. The page does need a secure context (https or localhost) for the crypto API to work.
Does this tool hash files, or only text?
This tool hashes text you type or paste, not files. To verify a downloaded file, use a command-line tool such as certutil -hashfile on Windows or shasum / sha256sum on macOS and Linux, then compare the result to the publisher's listed checksum.
What is the difference between hashing and encryption?
Encryption is reversible: with the right key you can decrypt ciphertext back to the original data. Hashing has no key and no reverse operation, it only proves that data matches a known digest. They solve different problems and are not interchangeable.
Can two different inputs ever produce the same hash?
In theory yes, since a hash has a fixed number of possible outputs but an infinite number of possible inputs; this is called a collision. For SHA-256 and SHA-512 no practical collision has ever been found, which is why they remain trusted, while SHA-1 and MD5 have known practical collision attacks.
Does this tool support HMAC?
No. HMAC combines a message with a secret key and needs a separate key input, which is a different workflow from hashing plain text. This tool computes standard SHA-1, SHA-256, and SHA-512 digests of your text only.