The SHA-256 hash of the 3-byte text abc is `ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad`, a 256-bit digest that matches NIST’s published example. This free hash generator returns MD5, SHA-1, SHA-256, SHA-384 and SHA-512 hashes of any text, in hex or Base64. Nothing you enter reaches our server.
Hash
ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad
The SHA-256 hash of 3 bytes of text is 256 bits long.
- Hash
- ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad
- Compared with the expected hash
- No expected hash given
- Algorithm
- SHA-256
- Digest length (bits)
- 256
- Input size (bytes)
- 3
Every algorithm
| Algorithm | Hash | Status |
|---|
How this is calculated
- How it works
- SHA-1 and the SHA-2 hashes, specified in NIST FIPS 180-4 (opens in new window), come from your browser's Web Crypto API; MD5, which Web Crypto does not offer, is computed by this page's own code and checked against the RFC 1321 test suite. Text is hashed as UTF-8 bytes, the same as sha256sum on a UTF-8 file with no trailing newline. A file is read in the page with your browser's File API, up to 100 MB, and hashed byte for byte, so its line endings count; it is never uploaded. An expected hash is compared with all five results, in hex or Base64.
- Not covered
- Files up to 100 MB.
- Privacy
- What you enter never reaches our server. It is processed on your device, inside this page.
- Corrections
- Report a wrong result to media@sqmagazine.co.uk; every report is reviewed and confirmed errors are corrected. Include the inputs and the answer you expected. With your permission, we thank you by name on this page.
- Updates
- Published.
- Feedback
- How useful was this tool?
Table of Contents
How to Use the Hash Generator
Give the hash generator one piece of text and it returns that text’s hash. The “Algorithm” menu offers “SHA-256” (the default), “SHA-512”, “SHA-384”, “SHA-1” or “MD5”. It also lists all 5 hashes of the same text and recalculates as the text changes.
- Type or paste the text into “Text to hash”. The tool reads it exactly as entered, spaces and line breaks included.
- Choose an “Algorithm” from that list, or keep the default.
- Choose an “Output format”: “Hexadecimal” or “Base64”.
- Read “Hash”, then check “Algorithm”, “Digest length (bits)” and “Input size (bytes)”.
- Use the “Every algorithm” table below the result to compare every hash of the same text, each with a short status note.
“Copy” puts the hash on the clipboard. “Copy all details” copies the results without the text, and “Download CSV” saves the results and the table, also without the text. “Share result” builds a link that carries the algorithm and the format, never the text. “Reset” restores the default input.
Behind the result sit two standards: NIST’s Secure Hash Standard for the SHA hashes and the IETF’s specification for MD5. Both define how the hash is worked out.
How a Hash Is Calculated
Three steps turn text into a hash: encode the text as bytes, hash the bytes, and write the fixed-size result as hex or Base64. NIST’s Secure Hash Standard, FIPS 180-4, specifies hash algorithms that can be used to generate digests of messages. Those digests are used to detect whether messages have been changed since the digests were generated.
- Text to bytes. The text is encoded as UTF-8. The IETF’s RFC 3629 says UTF-8 stores characters using sequences of 1 to 4 octets, and plain ASCII letters take one octet each. “Input size (bytes)” counts octets, not characters.
- Bytes to digest. SHA-1, SHA-256, SHA-384 and SHA-512 come from the browser’s built-in W3C Web Cryptography API. It implements the SHA-1 and SHA-2 families, as specified by FIPS-180-4. That API has no MD5, so the page runs its own MD5 code, written to the IETF’s MD5 specification. MD5 outputs a 128-bit fingerprint or message digest of the input.
- Digest to text. Hex writes each byte as two characters, so its length is the digest length in bits divided by four. Base64, defined in RFC 4648, represents 24-bit groups of input bits as output strings of 4 encoded characters. An “=” pads the last group.
With L as the digest length in bits:
- Hex characters = L / 4.
- Base64 characters = 4 × (L / 24, rounded up), padding included.
| Algorithm | Digest length (bits) | Hex characters | Base64 characters | Defined in |
|---|---|---|---|---|
| MD5 | 128 | 32 | 24 | RFC 1321 |
| SHA-1 | 160 | 40 | 28 | FIPS 180-4 |
| SHA-256 | 256 | 64 | 44 | FIPS 180-4 |
| SHA-384 | 384 | 96 | 64 | FIPS 180-4 |
| SHA-512 | 512 | 128 | 88 | FIPS 180-4 |
Source: digest lengths from NIST FIPS 180-4 (Figure 1) and RFC 1321; character counts computed from two hex characters per byte and RFC 4648
Digest length never depends on the input. A single letter and a long document both give a SHA-256 hash of 64 hex characters.
Each of those steps shows up in the default input.
Hash Generator Example: SHA-256 of the Default Input
On load, “Text to hash” holds abc, “Algorithm” on “SHA-256” and “Output format” on “Hexadecimal”. Five steps rebuild the result panel:
- Bytes. The letters a, b and c are ASCII, one byte each (61, 62 and 63 in hex), so “Input size (bytes)” reads 3.
- Digest size. SHA-256 outputs a 256-bit message digest, which is what “Digest length (bits)” shows.
- Hash. The hex form is 64 characters long: `ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad`. Running `sha256sum` on the same bytes gives the same string.
- Check against NIST. NIST’s SHA-256 example values use abc as their one-block sample. They print the digest as BA7816BF 8F01CFEA 414140DE 5DAE2223 B00361A3 96177A9C B410FF61 F20015AD, the same value in capitals.
- Base64. Switch “Output format” to “Base64” and the same bytes read `ungWv48Bz+pBQUDeXa4iI7ADYaOWF3qctBD/YfIAFa0=`: 44 characters, ending in one “=”.
In the “Every algorithm” table, the MD5 row matches another standard. The test suite in the MD5 specification lists the MD5 of abc as `900150983cd24fb0d6963f7d28e17f72`, and the tool shows that exact string. Because the default input is a published test vector, anyone can check the page against NIST and the IETF before trusting it with other text.
A matching hash shows, with a very high probability, that the bytes match. It shows nothing more.
What the Hash Means
A hash is a fingerprint of exact bytes. The same input always gives the same digest. FIPS 180-4 adds that Any change to a message will, with a very high probability, result in a different message digest.
NIST’s Hash Functions project expects collision resistance from an approved hash. It is computationally infeasible to find two different inputs to the hash function that have the same hash value. It also expects preimage resistance. Given a randomly chosen hash value, it is computationally infeasible to find an input message that hashes to this hash value.
Infeasible does not mean secret. Anyone can hash a list of guesses and compare. The hash of a short or common input such as abc gives it away to anyone who tries it.
A hash is also not encryption. Encryption, like the tunnel described in how VPNs work, uses a key so the data can be read again. A hash has no key that turns it back into the text; the only route back is guessing.
What Hashes Are Used For
Hashes check that data has not changed, and they feed other cryptography. FIPS 180-4 says Secure hash algorithms are typically used with other cryptographic algorithms, such as digital signature algorithms and keyed-hash message authentication codes, or in the generation of random numbers (bits).
- Integrity checks. Two copies of the same text give the same hash, so comparing hashes shows whether a copy changed on the way.
- Digital signatures. The MD5 specification says The MD5 algorithm is intended for digital signature applications, where a large file is condensed before it’s signed. That use is the one MD5 has since lost.
- Keyed hashes. Message authentication codes mix a secret key into the hash. This tool has no key field, so it doesn’t produce them.
Which algorithm fits depends on whether anyone might try to forge a match.
MD5 vs SHA-1 vs SHA-256
For anything an attacker might try to forge, the standards point to the SHA-2 family: SHA-256, SHA-384 and SHA-512 on this page. MD5 and SHA-1 still produce correct hashes. What they lost is collision resistance.
The IETF’s RFC 6151 says MD5 is no longer acceptable where collision resistance is required such as digital signatures. That is why the tool’s table marks MD5 as fit for checksums only.
SHA-1 followed. According to NIST’s project page, NIST deprecated the use of SHA-1 in 2011 and disallowed its use for digital signatures at the end of 2013. NIST adds that collision attacks have been used to undermine SHA-1 in recent years. Its retirement notice says SHA-1 should be phased out by Dec. 31, 2030, in favor of the more secure SHA-2 and SHA-3 groups of algorithms.
SHA-3 is not on offer here; SHA-256, from the SHA-2 family, is the default.
Why a Fast Hash Is Not Password Storage
A SHA-256 or MD5 hash of a password isn’t safe password storage, because it has no salt and no cost factor. NIST’s Digital Identity Guidelines say Passwords SHALL be salted and hashed using a suitable password hashing scheme.
Password hashing schemes take a password, a salt, and a cost factor as inputs and generate a password hash. Their purpose is to make each password guess more expensive for an attacker who has obtained a hashed password file.
This tool applies neither. A password gives the same digest every time, on every computer. Stolen credentials run through our password statistics and data breach statistics. A fast, unsalted hash does little to slow a guessing attack on a leaked file.
Hashing a sample password here shows what a digest looks like. Never paste a password in real use into any web page.
Why the Same Text Can Give a Different Hash
Many mismatched hashes come from bytes nobody can see. The common one is a trailing newline. `echo ‘abc’ | sha256sum` adds a line break and hashes 4 bytes, which returns `edeaaff3f1774ad2888673770c6d64097e391bc362d7d6fb34982ddf0efd18cb`. `printf ‘abc’ | sha256sum` hashes the 3 bytes and matches the tool.
- A pasted newline. The tool hashes the text exactly as typed. If “Input size (bytes)” reads one more than expected, a line break came along with the paste.
- Characters outside ASCII. An accented letter such as é takes 2 bytes in UTF-8, so “Input size (bytes)” can exceed the character count.
- Hex case and format. NIST prints hashes in capitals and the tool in lowercase; the value is the same. A Base64 hash and a hex hash of the same text look nothing alike but hold the same bytes.
Check the byte count before the hash.
What is a hash generator?
A hash generator computes a fixed-length digest of its input with a named algorithm such as SHA-256 or MD5. Per NIST, the digests are used to detect whether messages have been changed since the digests were generated. This one works on typed or pasted text, not on files.
Is MD5 still used today?
Yes, where nobody is trying to forge a match. RFC 6151 says It is not urgent to stop using MD5 in other ways, such as HMAC-MD5, while ruling it out wherever collision resistance is required. It adds that new protocol designs should not employ HMAC-MD5. The tool offers MD5 for matching older checksums, not for signatures.
Good to Know Before You Use It
The hash generator runs in your browser and nothing you enter reaches our server. It hashes the text as UTF-8 bytes exactly as entered, with no trimming of spaces or line breaks. The text stays out of the share link, “Copy all details” and the CSV; the hash goes into them.
The SHA hashes come from the browser’s Web Cryptography API, which implements the SHA-1 and SHA-2 families, as specified by FIPS-180-4. MD5 comes from the page’s own code, checked against the test suite in its specification. Every digest has a fixed length, from 128-bit MD5 to 512 bits for SHA-512. The tool does not hash files, compute keyed hashes, add a salt or cost factor, offer SHA-224 or SHA-3, or reverse a hash.
SQ Magazine publishes this page for information. A hash helps detect whether text has changed; it promises no security outcome, and a fast hash of a password is not safe password storage.
Conclusion
On its default input, the hash generator turns abc into the 256-bit SHA-256 digest that NIST publishes as its own example. That makes the page easy to check before relying on it. Pick SHA-256 or longer for anything someone might forge, and compare byte counts before comparing hashes. For the wider picture of how organizations protect their data, see our guide to securing a business from cyber attacks.
























































