Hash Generator – MD5, SHA-1 and SHA-256 Digests of Any Text
Generate the MD5, SHA-1 and SHA-256 digest of any text or string, with the output length in bits and hex characters, and a clear explanation of which algorithms are safe to use.
Calculator InputsFormula v1.0
Spaces, capitalisation and line breaks all change the digest.
Digest = H(UTF-8 bytes of the input), where MD5 produces 128 bits, SHA-1 produces 160 bits and SHA-256 produces 256 bits, rendered as lowercase hexadecimal
SHA-256 digest
256 bits, 64 hexadecimal characters
• SHA-256 is the appropriate default for checksums, signatures and integrity checks.
• Hashes are computed locally from the text you type; nothing is submitted to a server.
Step-by-Step Mathematical Working
Formula and method
Digest = H(UTF-8 bytes of the input), where MD5 produces 128 bits, SHA-1 produces 160 bits and SHA-256 produces 256 bits, rendered as lowercase hexadecimalA hash is a one-way fingerprint, not encryption: there is no key that reverses it, and the same input always produces the same digest. Two inputs that differ by a single character produce completely different digests, which is what makes hashes useful for detecting accidental changes and for storing password verifiers.
Variables
- Input text
- The exact string to hash, including spaces, punctuation and case
- Algorithm
- The digest function whose output is required
- Digest
- Fixed-length hexadecimal representation of the hash value
Worked example
The text "abc" hashes to 900150983cd24fb0d6963f7d28e17f72 under MD5, a9993e364706816aba3e25717850c26c9cd0d89d under SHA-1 and ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad under SHA-256.
Who this calculator is for
Developers checking a checksum, students learning how message digests differ from encryption, and anyone verifying that two strings differ by a single character.
Complete guide to the hash generator – md5, sha-1 and sha-256 digests of any text
Every figure below comes from this calculator itself. The method is Digest = H(UTF-8 bytes of the input), where MD5 produces 128 bits, SHA-1 produces 160 bits and SHA-256 produces 256 bits, rendered as lowercase hexadecimal, applied to the tool's default inputs and then stress-tested one input at a time.
What the Hash Generator – MD5, SHA-1 and SHA-256 Digests of Any Text works out
Hash Generator – MD5, SHA-1 and SHA-256 Digests of Any Text answers one specific question: Generate the MD5, SHA-1 and SHA-256 digest of any text or string, with the output length in bits and hex characters, and a clear explanation of which algorithms are safe to use. It is written for developers checking a checksum, students learning how message digests differ from encryption, and anyone verifying that two strings differ by a single character.
The method is Digest = H(UTF-8 bytes of the input), where MD5 produces 128 bits, SHA-1 produces 160 bits and SHA-256 produces 256 bits, rendered as lowercase hexadecimal. The inputs are Text to hash, Primary algorithm. With the default values - Text to hash = CalculatorFlash, Primary algorithm = sha256 - the result is SHA-256 digest: e3bf5e51d7281c58bdf0be5e2b699cde6ff7695a8ac5efbb557f60659a14d54c.
Reading the output line by line
Alongside e3bf5e51d7281c58bdf0be5e2b699cde6ff7695a8ac5efbb557f60659a14d54c this method reports 9 supporting quantities: Input length: 15 characters, 15 UTF-8 bytes; MD5: f7ec235dad181fd6f3489021771e805c; SHA-1: 323a654269d48fa258bd13837f58ad7303674368; SHA-256: e3bf5e51d7281c58bdf0be5e2b699cde6ff7695a8ac5efbb557f60659a14d54c. Reading them together shows which part of the calculation is doing the work.
The arithmetic as executed: Encode the input as UTF-8: 15 bytes. Split the message into 512-bit blocks, append a 0x80 marker and the 64-bit length. Run the algorithm's compression function over every block with its fixed initial state and round constants. Render the SHA-256 state as hexadecimal: e3bf5e51d7281c58bdf0be5e2b699cde6ff7695a8ac5efbb557f60659a14d54c. Reproduce the steps once by hand; if your numbers match, the model and your inputs are consistent.
How to interpret the answer
A hash is a one-way fingerprint, not encryption: there is no key that reverses it, and the same input always produces the same digest. Two inputs that differ by a single character produce completely different digests, which is what makes hashes useful for detecting accidental changes and for storing password verifiers.
In this case e3bf5e51d7281c58bdf0be5e2b699cde6ff7695a8ac5efbb557f60659a14d54c together with input length of 15 characters, 15 UTF-8 bytes is a single scenario, not a forecast range. Move the input you are least sure of, and watch the two figures change in step.
Common mistakes to avoid
Treating MD5 or SHA-1 as a security control for signatures or certificates; both have practical collision attacks. Hashing a password with a fast algorithm and no salt, which lets an attacker precompute a rainbow table. Comparing hex digests case-sensitively when one tool prints uppercase and the other lowercase. Hashing text after trimming or lowercasing it, which changes the digest and breaks a checksum comparison.
Read the inputs back once before trusting the figure: Text to hash, Primary algorithm and confirm each entry matches its label, including whether a quantity is entered in the unit the label names. Test one alternative scenario so you can see how sensitive the answer really is.
Limitations and responsible use
MD5 and SHA-1 are unsuitable for security decisions because collisions can be constructed. A plain hash is not a password-storage scheme; use a dedicated slow function such as Argon2, scrypt or bcrypt with a per-user salt. The digest proves nothing about the truth of the content, only that it matches whatever produced the comparison digest.
Read the figures above as conditional on those limits rather than as a guarantee. CalculatorFlash shows the formula, the substitution and the units so the arithmetic can be checked by hand, but it cannot verify that the inputs describe your real circumstances. For a consequential decision, confirm the current figure independently, because published values change between editions.
Frequently asked questions
What is the SHA-256 hash of abc?
ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad. The same input always produces this digest.
Can a hash be reversed?
Not in general. Hashing is deliberately lossy. What attackers do instead is guess inputs and hash each guess, which is why long random passwords resist cracking and short dictionary words do not.
Should I use MD5 for file checksums?
For detecting accidental corruption, MD5 is adequate. For verifying a download against a published checksum where an attacker might tamper, use SHA-256, because MD5 collisions can be engineered.
Why do MD5 and SHA-1 give different lengths?
They have different internal state sizes: MD5 is a 128-bit digest written as 32 hex characters, SHA-1 is 160 bits as 40 characters, and SHA-256 is 256 bits as 64 characters.
Related searches for this calculator
People also look for hash generator, md5 generator, sha256 generator, sha1 hash calculator, online hash calculator and checksum calculator. Everything on this page is calculated in your browser from the formula shown above.
Related Technology Calculators
Explore another calculator in this subject.
Password Strength Calculator – Entropy, Crack Time and Length Needed
Enter a password to see its length, character classes, entropy in bits, the search space an attacker faces, the average offline and online crack time, and the length needed to reach a target.
Random Number and Password Generator
Generate cryptographically strong random integers in a range, unique lottery-style picks, or secure passwords with configurable length and character classes.
Binary, Decimal and Hex Converter – Any Base From 2 to 36
Convert a number between binary, octal, decimal, hexadecimal and any base from 2 to 36, with the place-value expansion and bitwise views shown.