A download page prints a long string of hex characters next to a file, and you want to produce the same string from your own copy to check the two match. Or you are the one publishing a file, and you need to create that string in the first place. Either way, the job is the same: run the file or text through a hash algorithm and read the digest that comes out.

The free SHA Hash Generator on Ovatly computes SHA-1, SHA-256, SHA-384 and SHA-512 hashes using Web Crypto, the cryptographic engine built into your browser. Files never leave your device, and the tool works offline once the page has loaded. This guide walks through the one workflow that covers all four algorithms, how to choose between them, and the small trap that causes most mismatches.

Contents

  • Quick answer
  • What a SHA hash actually is
  • Four algorithms, one workflow
  • How to generate a hash, step by step
  • Worked example: hashing the text abc
  • The trailing newline trap
  • Limitations and honest tradeoffs
  • Common mistakes
  • FAQs
  • Conclusion
  • References

Quick answer

Open the SHA Hash Generator, pick your algorithm (SHA-256 is the right default), choose Text or File, enter the text or select the file, and click Compute. Copy the hex digest that appears. If you are checking against a published checksum, use the same algorithm the publisher used, and make sure your text input has no trailing newline, because that invisible character is part of the input and changes the result completely.

What a SHA hash actually is

A hash algorithm takes an input of any size and produces a fixed-length string of hex characters called a digest. The same input always produces the same digest, and changing even one character of the input produces a completely different one. There is no way to run the process backwards: a digest cannot be turned back into the file or text it came from.

That one-way property is what makes hashes useful for checking integrity. If your digest matches the reference digest, your bytes are identical to the bytes the reference was taken from. Notice what that does not say: a hash proves bytes match a reference, not who published them. The reference itself still has to come from somewhere you trust.

Four algorithms, one workflow

The tool offers four members of the SHA family, and they are not interchangeable.

SHA-256 is the default for good reason: it is the standard choice for new checksums and integrity checks, and no collision for it has ever been found in practice. SHA-1 is the older algorithm, kept only for verifying old published checksums that were issued as SHA-1. Collisions for SHA-1 have been demonstrated, so it is not suitable for new integrity claims. SHA-512 is fine on 64-bit systems, and SHA-384 is common in some standards; use either when a publisher or a standard specifically calls for it.

You may notice two absences. The tool offers no SHA-224 and no SHA3, because Web Crypto exposes the SHA-1 and SHA-2 family only, and the tool deliberately uses the audited built-in rather than bolting on its own implementation.

How to generate a hash, step by step

  1. Open the SHA Hash Generator and pick the algorithm. Choose SHA-256 unless a published checksum or a standard dictates a different one.
  2. Choose Text or File. For a file, select it from your device; it is read locally and never uploaded.
  3. Enter the text exactly as it should be hashed, or confirm the file you selected is the one you mean.
  4. Click Compute and copy the hex digest. If you are verifying, compare it character by character with the reference value.

Worked example: hashing the text abc

Type the three letters abc into the text box, select SHA-256, and compute. The result is the worked example published in FIPS 180-4, the standard that defines these algorithms:

ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad

If your run prints exactly that string, your workflow is correct, and you can trust the same steps on a real file. The example is also a neat demonstration of the trap in the next section: those three letters, with nothing after them, give this digest. Press Enter after typing them, so the input becomes abc plus a newline, and the digest changes completely, even though the text on screen looks identical.

The trailing newline trap

Text is hashed as UTF-8, exactly as entered, character for character. A trailing newline counts. So does a stray space pasted at the end of a line. This is the most common reason a result disagrees with an expected value, ahead of every other cause: the input looks the same as the reference input, but it is not the same bytes.

When a digest does not match, check the boring things first. Strip any trailing whitespace or line break from the text. Confirm you selected the same algorithm as the publisher, because a SHA-1 digest and a SHA-256 digest of the same input are different strings of different lengths. Only after those checks should you suspect the file itself.

Limitations and honest tradeoffs

Very large files are read fully into memory before hashing, so an enormous file can be slow or strain a modest device. That is the price of keeping everything local: nothing is uploaded, but your own machine does all the work.

The bigger limit is conceptual. A matching hash tells you the bytes are the same as the reference bytes, full stop. It does not vouch for the publisher, the safety of the file, or the honesty of the page that printed the checksum. And SHA-1 carries its own limit: because collisions have been demonstrated, a SHA-1 match is weaker evidence than a SHA-256 match, which is why it survives only as a way to check old published values.

Common mistakes

  • Picking a different algorithm from the publisher. A SHA-1 digest will never match a SHA-256 reference for the same file. Match the algorithm first; the length of the reference is a clue, since a SHA-1 digest is 40 hex characters and a SHA-256 digest is 64.
  • Leaving a trailing newline in pasted text. The invisible character is hashed too, and the digest changes completely.
  • Using SHA-1 for a new integrity claim. Collisions have been demonstrated. New checksums should be SHA-256.
  • Treating a match as proof of origin. The hash proves the bytes match a reference, not who published them. Get the reference from a trusted source.
  • Re-hashing an edited file and expecting the old checksum. Any change, even one added character, produces a new digest.

FAQs

Which SHA algorithm should I use? SHA-256 for almost everything. It is the right default for new checksums and integrity checks. Use SHA-1 only when you are verifying an old published checksum that was issued as SHA-1, and use SHA-384 or SHA-512 when a standard or a publisher's checksum file calls for them.

Is my file uploaded to a server? No. The hash is computed with Web Crypto inside your browser, and files never leave your device. The tool also works offline once the page has loaded.

Why does my hash not match the published one? The most common cause is a trailing newline. Text is hashed as UTF-8 exactly as entered, and a newline at the end is part of the input, so it produces a completely different digest. Check for extra spaces or a line break at the end, and confirm you picked the same algorithm as the publisher.

Why are SHA-224 and SHA3 not offered? The tool uses the browser's built-in Web Crypto, which exposes the SHA-1 and SHA-2 family only. SHA-224 and the SHA3 family are not part of that built-in set, so the tool deliberately sticks to the audited algorithms the browser provides.

Does a matching hash prove who published a file? No. A matching hash proves the bytes you have are identical to the bytes the reference hash was taken from. It says nothing about who produced those bytes, so the reference hash still has to come from a source you trust.

Conclusion

Generating a SHA hash is one short workflow: pick the algorithm, add text or a file, compute, copy the digest. The judgement sits in two places, choosing SHA-256 unless a published checksum dictates otherwise, and keeping your input byte-exact so a trailing newline does not sabotage the comparison. The SHA Hash Generator does the computing in your browser, with nothing uploaded. If you are wondering why SHA-1 still appears on old download pages at all, our comparison of SHA-1 vs SHA-256 explains what changed. For more guides in this series, see our Security and Privacy guides.

References