A hash is the closest thing computing has to a fingerprint. Feed in a file, a password, a single letter, and a hash function returns a short, fixed-length string that identifies those exact bytes. Change one byte and the string changes beyond recognition. SHA-256 is the member of the SHA family that the modern internet runs on: it is the checksum printed next to serious downloads, and the same family of fingerprints used in certificates and git commits.

This explainer covers what a SHA hash actually is, how the family members differ, and how to generate one with the free SHA Hash Generator on Ovatly, which computes SHA-1, SHA-256, SHA-384 and SHA-512 digests in your browser using the Web Crypto API. Files never leave your device, and the tool works even with the network disconnected.

Contents

  • Quick answer
  • What a hash actually does
  • The SHA family: 1, 256, 384 and 512
  • How to generate a SHA hash, step by step
  • Worked example: the FIPS test vector for abc
  • Limitations and honest tradeoffs
  • Common mistakes
  • FAQs
  • Conclusion
  • References

Quick answer

A SHA hash is a fixed-length fingerprint of some data, computed by a one-way function: easy to compute, infeasible to reverse, and different for any different input. SHA-256, the default in the SHA Hash Generator, produces a 256-bit fingerprint written as 64 hex characters, and it is the right choice for almost everything. The SHA-256 of the text abc is ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad, the worked example printed in the FIPS 180-4 standard, so you can verify any tool against a known answer.

What a hash actually does

Three properties make a hash useful. First, it is deterministic: the same input always gives the same output, so a digest you compute today can be compared with one a publisher computed years ago. Second, the output is fixed in length no matter how large the input is: a one-line text file and a full disk image both produce a 64-character SHA-256 digest. Third, it is one-way: the digest reveals nothing practical about the input, and there is no operation that turns a hash back into the data it came from.

Put together, those properties make a hash a comparison tool. You do not need to hold two files side by side and diff them; you compare two short strings. If they match, the bytes match. That is why publishers release digests alongside downloads, and why the same mathematics fingerprints certificates and git commits: anywhere a long piece of data needs a short, trustworthy name, a hash is that name.

The SHA family: 1, 256, 384 and 512

The number in the name is the length of the fingerprint in bits. SHA-256 produces 256 bits, shown as 64 hex characters; SHA-512 produces 512 bits, shown as 128. A longer output means a larger space of possible fingerprints, which is what makes accidental or engineered collisions harder to find.

SHA-1 is the family's cautionary tale. It was once the default, but collisions have been demonstrated, so it is no longer trustworthy for new integrity claims. The generator still offers it for one narrow job: verifying old published checksums that were only ever released as SHA-1 values. SHA-384 is a shortened relative of SHA-512 that appears in some security standards. SHA-512 is a fine alternative to SHA-256, particularly on 64-bit systems.

You will not find SHA-224 or SHA3 in the tool. The browser's Web Crypto API exposes SHA-1 and the SHA-2 family (256, 384, 512) only, and the tool deliberately uses that audited built-in implementation rather than a script port of the missing algorithms.

How to generate a SHA hash, step by step

  1. Open the SHA Hash Generator and pick the algorithm. SHA-256 is the right default unless a publisher's checksum tells you otherwise.
  2. Choose Text or File and provide the input. Files are read by your browser and never leave your device.
  3. Press Compute.
  4. Copy the hex digest and compare it with the published value, or save it as the reference for later, for example alongside a backup.

Match the algorithm to the reference you are checking against. A SHA-256 digest will never equal a SHA-1 value for the same file, because they are different fingerprints, not different spellings of one fingerprint.

Worked example: the FIPS test vector for abc

Standards documents publish worked examples precisely so you can check an implementation against a known answer. FIPS 180-4, the standard that defines the SHA family, uses the text abc:

SHA-256 of abc: ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad

Type abc into the generator, select SHA-256, and compute. If the tool returns exactly that string, the implementation is behaving. Then add one trailing newline and compute again: the digest changes completely, because the newline is part of the input. Text is hashed as UTF-8 bytes, and every byte counts. Keep that experiment in mind whenever a computed hash disagrees with a published one, because the trailing newline is the most common cause.

Limitations and honest tradeoffs

A hash proves that bytes match a reference value. It does not prove who published the file. If you download a file and its checksum from the same untrusted place, a match tells you the two agree with each other, nothing more. For origin, pair the hash with a signature or take the reference value from a trusted source.

Very large files are read fully into memory before hashing, so an enormous file can be slow or strain a small device. And while collisions exist in principle for any hash function, no SHA-256 collision has ever been found in practice; the space of possible outputs is far too large to search. That practical fact, not a theoretical guarantee, is what SHA-256's reputation rests on, and it is why SHA-1, where collisions have been demonstrated, is treated differently.

Common mistakes

  • Comparing digests from different algorithms. A SHA-1 value pasted into a SHA-256 field will never match. Check which algorithm the publisher used before concluding anything.
  • Blaming the tool for a trailing newline. Text is hashed as UTF-8 and the newline counts. It is the most common reason a hand-typed check value disagrees.
  • Treating a match as proof of origin. The hash proves the bytes match a reference, not that the reference came from who you think it did.
  • Using SHA-1 for a new integrity claim. Its collisions are demonstrated, not theoretical. Keep it for verifying old published checksums only.
  • Typing the expected digest by hand. One wrong hex character guarantees a mismatch. Copy the reference value instead.

FAQs

Which SHA should I choose? SHA-256 for almost everything. SHA-512 is a fine alternative on 64-bit systems; SHA-384 is common in some security standards. SHA-1 only for legacy checks.

Why is there no SHA-224 or SHA3? The browser's Web Crypto API exposes SHA-1 and the SHA-2 family (256, 384, 512) only, and this tool deliberately uses that audited built-in implementation rather than a script port.

Can two different files share a SHA-256 hash? In principle collisions exist for any hash, but no SHA-256 collision has ever been found in practice; the space is far too large to search.

Is my file uploaded for hashing? No. Your browser reads and hashes it locally; you can disconnect from the network and the tool still works.

Why does my computed hash not match the published one? Text is hashed as UTF-8, and a trailing newline counts as part of the input. That newline is the most common reason a hand-typed check value disagrees.

Conclusion

A SHA hash turns any data into a short fingerprint you can compare, publish and store. SHA-256 is the member of the family to reach for by default, with SHA-512 and SHA-384 for the cases that call for them and SHA-1 kept only for legacy checks. If you meet the older 32-character fingerprints on download pages and wonder how they compare, How to Generate an MD5 Hash of a Text or Value covers the MD5 side, including why it no longer counts as security. For more guides in this series, see our Security and Privacy guides, which pair each technique with the free tool that performs it.

References