Skip to content
QuikTools Hub

SHA-256 Explained: What a Hash Is and How to Check One

Published: 15 November 2026 · by Umar Farooq Iftikhar

A download page lists a 64-character string labelled SHA-256, next to the installer. A developer pastes a checksum into a chat and asks whether it matches. A tutorial tells you to hash a value before storing it. All three are the same idea: a short fingerprint that stands in for a much longer piece of data, computed so that any change to the data gives, with very high probability, a completely different fingerprint. The Hash Generator computes SHA-256 and its siblings for any text you type or paste, free in your browser, and this guide explains what the string means, how to use it, and where its limits are.

SHA-256 is one member of the SHA family of hash functions, specified by the US National Institute of Standards and Technology in FIPS 180-4, the Secure Hash Standard. It takes a message of less than 2 to the power of 64 bits — the length limit the standard sets for SHA-256, far beyond any text typed or pasted into a browser tool — and produces a fixed 256-bit digest, usually written as 64 hexadecimal characters. The same input always produces the same digest. A different input, even by one character, produces a digest that, with very high probability, looks entirely unrelated. Those two properties, determinism and the avalanche effect, are what make hashes useful for verification — and the one-wayness, the fact that no key or reverse step recovers the input, is what separates a hash from encryption. This guide works through a concrete example first, then the SHA family, the practical jobs, and the mistakes.

What a hash is: a fingerprint, not a lock

Think of a fingerprint, not a lock. A lock hides something and opens with a key; a fingerprint identifies something without revealing it. A hash function takes a message — for SHA-256, anything less than 2 to the power of 64 bits — and returns a fixed-size digest: always 256 bits, always 64 hexadecimal characters, whether the input is three letters or three megabytes of text. The digest is a condensed representation of the input, in the standard's own words — a short string from which recovering the input is computationally infeasible: the generic way back is guessing candidate inputs and hashing each one, which succeeds only when the input is short or predictable — but against which any claimed copy of the input can be checked. Hash the same input again and you get the same digest; hash anything even slightly different and, with very high probability, you get a different one. That is the whole mechanism, and every use in this guide follows from it.

Three distinctions keep the subject clear. First, a hash is not encryption: encryption is reversible with a key, and a hash has no key and no reverse step — there is nothing to decrypt. Second, a hash is not encoding: Base64 encoding turns data into text that can be decoded back to the original, while a hash offers no feasible way back to the original: recovering it would require guessing candidate inputs. Third, a hash is not a signature on its own: a digest proves that data matches a digest, but on its own it says nothing about who produced the data — the section on what a hash is not returns to that gap.

A worked example: three inputs, three unrelated digests

The classic test input is the string abc. Its SHA-256 digest is ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad, the value developers use to confirm a new implementation is correct. You can use that value to confirm any hash tool, including the one on this site: hash abc and you should see exactly that string. Hash the empty string — nothing at all — and SHA-256 returns e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855. Even nothing hashes to a full-length digest, which is the fixed-length property in its starkest form.

Now change one letter. The string abd hashes to a52d159f262b2c6ddb724a61840befc36eb30c88877a4030b65cbe86298449c9. Compare it with the digest for abc: 58 of the 64 characters differ, and the six that match do so in scattered positions with no pattern. That is the avalanche effect — a one-character change produces a digest with no visible relation to the original — and it is deliberate. A hash that changed a little when its input changed a little would leak information about the input; a hash whose output changes unpredictably denies an observer that particular foothold — though the avalanche effect on its own says nothing about whether a short or predictable input can be guessed. The standard puts it as a probability: any change to a message will, with a very high probability, result in a different message digest. One comparison illustrates the effect; it does not statistically establish it — the avalanche property is a design property of the algorithm, assessed over many inputs rather than proven by a single pair.

Determinism is the other half. Hash abc a thousand times, on any machine, in any correct implementation, and you get ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad every time. That reproducibility is what makes hashes useful for verification: two people who have never met can compare digests and establish, with very high probability, whether they hold the same data, without exchanging the data itself.

The three properties that make a hash useful

A cryptographic hash function is assessed against three resistance properties. The standard states two of them as design requirements: it must be computationally infeasible to find a message that corresponds to a given digest, and computationally infeasible to find two different messages that produce the same digest. The first is preimage resistance: finding a message that corresponds to a given digest is computationally infeasible — the generic method is guessing inputs one by one, which is out of reach for any input that is not short or predictable. The second is second-preimage resistance: given a message already specified, finding a different message with the same digest is computationally infeasible. The third is collision resistance: finding any two different messages that share a digest, with neither specified in advance, is computationally infeasible. The difference between the last two matters: a collision search may try any pair of messages, while a second-preimage search must match one fixed target, which is why the generic collision search is far cheaper than the generic second-preimage search, as the numbers below show.

Separate from the three resistance properties is the avalanche effect shown above: a desirable behaviour in which similar inputs give, with very high probability, unrelated outputs. It is what makes the digest behave unpredictably, but it is a design characteristic, not a resistance property: SHA-1's outputs avalanche as designed, yet collisions have been demonstrated against it.

The scale is worth stating plainly. SHA-256 has 2 to the power of 256 possible digests — about 1.16 times 10 to the power of 77. Finding a specific input from its digest by guessing would take on the order of 2 to the power of 256 tries. Finding a second message that matches one already specified is also a fixed-target search, but its strength depends on the length of the specified message: NIST expresses it as 256 minus L(M) bits, so for ordinary short messages it is practically close to 256 bits. Finding any two inputs that collide takes far fewer, about 2 to the power of 128, by the birthday bound — the same square-root effect behind the birthday paradox — but 2 to the power of 128 is still about 3.4 times 10 to the power of 38, far beyond any feasible search. These resistances are design properties, not proofs: they hold for SHA-256 because no practical attack is known, and collision resistance fails for SHA-1, where collisions have been demonstrated — which is why the family comparison below matters.

The SHA family on one page

The name SHA covers several functions, and the number in each name is the digest size in bits — which fixes the length of the string you see, since each hexadecimal character encodes 4 bits. The browser's Web Crypto API, which this site's generator uses, offers exactly four of them:

  • SHA-1: 160 bits, shown as 40 hex characters. Legacy only. SHA-1 is no longer collision-resistant — researchers have demonstrated two different inputs with the same SHA-1 digest — and the browser documentation warns against using it in cryptographic applications. It remains for compatibility with old checksums; NIST plans to remove its specification from the standard in FIPS 180-5 and phase it out by 31 December 2030. The generator shows a warning whenever SHA-1 is selected.
  • SHA-256: 256 bits, shown as 64 hex characters. The general-purpose default for the checksums that download pages, package registries and APIs publish.
  • SHA-384: 384 bits, shown as 96 hex characters. Used where a standard or a TLS-related convention calls for it.
  • SHA-512: 512 bits, shown as 128 hex characters. Choose it when a specification asks for it or when matching an existing digest of that length.

The standard also defines SHA-224 and two truncated SHA-512 variants, but the browser API does not offer them, and neither does this tool. MD5, an older 128-bit hash whose collision resistance is broken, is likewise not offered by the Web Crypto API. SHA-256 is the modern choice for new integrity and security work, but it is not an interchangeable replacement for every historical MD5 use: an existing MD5 checksum cannot be reproduced with SHA-256, and systems that must match published MD5 values need MD5 itself. If a tutorial asks for an MD5 value for a new job, check whether it also accepts a SHA-256 one.

Longer is not automatically better for every job, but it is not meaningless either: a longer digest provides a larger security margin, and some standards, protocols, and long-lived uses require SHA-384 or SHA-512. For ordinary integrity checks, both SHA-256 and SHA-512 sit far beyond brute force, and the practical rule is to match the algorithm the other side published — the requirement comes from the use case and the standard involved, not from a universal ranking. A 64-character digest cannot be compared with a 128-character one; length is your fastest sanity check that you generated what you meant to.

What SHA-256 is used for

The most visible job is verifying downloads. A software publisher computes the SHA-256 digest of a release file and prints it on the download page; you hash the file you received and compare. A match means the file you hold matches the reference digest — assuming the reference itself is authentic and SHA-256 remains suitable for the check; it does not independently prove who published the file. A mismatch means something changed in transit or the file is not the one the reference describes. The next section walks through the comparison step by step, including the honest complication that this site's tool hashes text, not files.

The quieter jobs are at least as important. Content addressing: systems that store data by its hash use the digest as the address, which makes it possible to recognize identical content and to detect corruption on read. Some such systems — version-control repositories, package registries, container images — deduplicate identical content, storing one copy under its digest; but that is a design choice of each system, not something the hash itself guarantees. Cache keys and fingerprints: a digest of a value makes a compact, stable key for caching, deduplication and change detection — hash a document today and next week, and equal digests mean, with very high probability, that the document is unchanged. And as a building block: keyed constructions such as HMAC and digital signatures use SHA-256 inside them, though building those correctly needs the dedicated constructions, not a bare hash.

How to check a checksum

The comparison itself is simple, and the discipline is in the details. First, get the published digest from the publisher's own page or release notes — not from the same untrusted mirror as the file, for reasons the section on proof of origin explains. Second, compute the digest of what you received, with the same algorithm the publisher used. Third, compare the two strings character by character, ideally by pasting both into a text comparison rather than eyeballing them: 64 characters is long enough that a single differing character hides easily. A full match means the bytes you hold match the reference digest, assuming the reference is authentic and the algorithm remains suitable. Any difference, anywhere, means they do not match the reference — re-download from the publisher's own source rather than running the file.

For files, the computation happens outside the browser, in your operating system's checksum utility: sha256sum on Linux, shasum -a 256 on macOS, and certutil with the hashfile option on Windows. Each prints the digest of the file you name, which you then compare with the published value. For text — a pasted value, a configuration string, a test vector — the Hash Generator does the same job in the browser: paste the text, keep SHA-256 selected, click Generate hash, and compare the 64-character result. The tool hashes text only and never reads files, which is a deliberate scope: your documents are never uploaded anywhere, and the file route above covers the download-verification job.

Why two hashes of the "same" text disagree

When a digest from one place disagrees with one from another, the input is almost never what you think it is. The hash covers every byte, so the usual causes are small and invisible:

  • A trailing space or line break crept in during pasting. The hash covers every character, so abc and abc with a trailing space are different inputs with different digests. Paste into a plain-text editor first if a mismatch puzzles you, and check for a final newline.
  • A different algorithm was selected on one side. A 64-character result is SHA-256 and a 128-character one is SHA-512; compare lengths first, before comparing characters.
  • The text was encoded differently. This tool encodes text as UTF-8 bytes before hashing. Matching visible text is not enough: both sides must hash the same bytes using the same encoding, or the digests will differ even when the characters on screen look identical. A system encoding the same characters in UTF-16, Latin-1, or another encoding will produce a different digest for the same visible text.
  • Letter case in the digest itself. Digests are conventionally shown in lowercase hexadecimal, and this tool follows that convention. Uppercase and lowercase hex spell the same value, so compare case-insensitively if one side uses capitals.

None of these is a fault in the algorithm. A hash that tolerated nearly the same input would be useless for verification; its whole value is that it refuses to.

What a hash is not

A hash is not encryption. Encryption hides data and recovers it with a key; a hash has no key, hides nothing recoverably, and cannot be decrypted back to the original. Finding an input from a digest is computationally infeasible in general; the practical route is guessing candidate inputs and hashing each one until a match appears, which is practical only for short or predictable inputs — which is exactly why password storage needs something else.

A hash is not password storage. The SHA family is fast by design, and fast is exactly what password storage must not be: an attacker with a leaked database can test candidate after candidate at the full speed the hardware allows, because the function is designed to be fast and cheap to compute. Nothing in the hash itself slows the guessing down: if a password is guessable, its plain SHA-256 digest gives it away as soon as the right guess is tried. Passwords need a dedicated password-hashing function — bcrypt, Argon2 or scrypt — with a unique salt per password and a deliberate computational cost. The guessing-rate arithmetic in How Strong Is Your Password? Entropy in Plain English shows why length matters there; the mechanism matters here.

And a matching hash is not proof of origin. A digest proves that the data you hold matches the digest you compared it with; it says nothing about who produced either. If an attacker can replace both the file and the checksum printed beside it, the comparison passes and proves nothing. That is why the published digest must come from a channel you trust independently of the download — the publisher's own site, a signed release note, a package registry — and why, for proof of authorship, signed releases exist. A hash verifies integrity against a reference; authenticating the reference is a separate job.

How to use the Hash Generator

The workflow is short. The box starts with the test string abc already entered, and SHA-256 already selected. Type or paste your text, choose an algorithm if you need a different one — SHA-384, SHA-512, or SHA-1 for an old checksum, which shows its legacy warning — and click Generate hash. The digest appears as lowercase hexadecimal, with a copy button beside it. Generation happens on click, not live as you type, and nothing is transmitted or stored: the browser encodes your text as UTF-8 and runs the Web Crypto digest function locally.

Two behaviours are worth knowing before you rely on them. First, the tool requires a secure context: Web Crypto is available only over HTTPS or on localhost, so on a plain HTTP page it reports that Web Crypto requires HTTPS instead of failing silently. Second, the tool hashes text only. There is no file picker and nothing is read from your disk; to verify a downloaded file, use your operating system's checksum utility as the earlier section describes, and use this tool for text values, test vectors and pasted digests.

Mistakes that waste an afternoon

  • Hashing a password with plain SHA-256 and calling it stored securely: speed is the enemy here. Use bcrypt, Argon2 or scrypt with a unique salt per password.
  • Comparing digests of different lengths: a SHA-256 value and a SHA-512 value will never match, whatever the input. Check the length — 64, 96 or 128 characters — before comparing a single character.
  • Pasting with a trailing newline: the extra character is part of the input. If two digests of the same text disagree, the invisible characters are the first suspects.
  • Using SHA-1 for a new security job because an old tutorial does: SHA-1's collision resistance is broken. Keep it for matching old checksums, and use SHA-256 for anything new.
  • Treating a matching hash as proof of authorship: it proves the data matches the reference, not that the reference is genuine. Get the reference from a channel you trust.
  • Expecting the tool to hash a file: it hashes text you type or paste. Files go through your operating system's checksum utility, which reads the file's bytes directly.

Conclusion

SHA-256 is a small, dependable idea: a message within the standard's length limit in, a fixed 256-bit fingerprint out, the same every time, and — with very high probability — unrelated for even slightly different inputs. It verifies downloads, fingerprints data, keys caches, and underpins signatures — and it does none of those jobs by hiding anything, which is precisely why it must not be asked to store passwords or prove authorship on its own. Used inside those limits, with the algorithm matched to the reference and the reference drawn from a trusted channel, it is one of the most reliable building blocks in software. Try the test vector on the Hash Generator: hash abc, and the 64-character digest from the worked example should be looking back at you.

Sources

1. National Institute of Standards and Technology, FIPS 180-4: Secure Hash Standard (SHS) — https://doi.org/10.6028/NIST.FIPS.180-4 — the standard specifying SHA-1, SHA-224, SHA-256, SHA-384, SHA-512, SHA-512/224 and SHA-512/256 (August 2015): digest sizes, the computationally-infeasible preimage and collision properties, and the very-high-probability digest change on any message change. Section 6.2 specifies SHA-256. Full text read 15 November 2026.

2. MDN Web Docs, SubtleCrypto: digest() method — https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/digest — supported digest values SHA-1, SHA-256, SHA-384 and SHA-512; secure-context requirement; output lengths and FIPS 180-4 section references; SHA-1 vulnerability warning; TextEncoder UTF-8 encoding and hex-string conversion examples. Accessed 15 November 2026.

3. National Institute of Standards and Technology, Computer Security Resource Center, FIPS 180-4: Secure Hash Standard (SHS) publication page — https://csrc.nist.gov/pubs/fips/180-4/upd1/final — current Final status; published August 2015; planning note (7 March 2023) recording the decision to revise FIPS 180-4. Accessed 15 November 2026.

4. National Institute of Standards and Technology, Decision to Revise FIPS 180-4, Secure Hash Standard — https://csrc.nist.gov/news/2023/decision-to-revise-fips-180-4 — the revision will remove the SHA-1 specification, add applicable SP 800-107 guidance, improve editorial quality, and update references. Accessed 15 November 2026.

5. National Institute of Standards and Technology, NIST Retires SHA-1 Cryptographic Algorithm — https://www.nist.gov/news-events/news/2022/12/nist-retires-sha-1-cryptographic-algorithm — SHA-1 to be phased out by 31 December 2030 in favour of SHA-2 and SHA-3; FIPS 180-5 to remove the SHA-1 specification; SP 800-131A revision planned. Published 15 December 2022, updated 8 April 2026. Accessed 15 November 2026.

6. National Institute of Standards and Technology, Computer Security Resource Center, Hash Functions project page — https://csrc.nist.gov/projects/Hash-Functions — approved hash algorithms specified in FIPS 180-4 and FIPS 202; SHA-1 deprecated in 2011 and disallowed for digital signatures at the end of 2013; December 2022 transition plan; security-strength table (SHA-256: 128-bit collision resistance, 256-bit preimage resistance); the three resistance properties — collision, preimage, and second preimage — defined. Accessed 15 November 2026.

Frequently asked questions

What do I do when a download page publishes a SHA-256 checksum?

Hash the file you received with your operating system's checksum utility — sha256sum on Linux, shasum -a 256 on macOS, certutil with the hashfile option on Windows — and compare the result with the published value character by character. A full match means the file matches the reference digest, assuming the reference is authentic and the algorithm remains suitable; it does not independently prove who published the file. Any difference means it does not match the reference: do not run it, and re-download from the publisher's own source. Get the published checksum from a channel you trust independently of the download itself, since a checksum printed beside a compromised file proves nothing. This site's Hash Generator hashes text, not files, so it covers pasted values and test vectors rather than the file step.

What is the difference between SHA-256 and SHA-512?

Digest size: SHA-256 produces 256 bits, shown as 64 hexadecimal characters; SHA-512 produces 512 bits, shown as 128. Both belong to the SHA-2 family, both are specified in FIPS 180-4, and no practical attack is known against either. SHA-512's longer digest provides a larger security margin, which some standards and long-lived uses require. SHA-256 is the general-purpose default for checksum publication — download checksums, APIs, registries — so use it unless a specification asks for SHA-512, your use case needs the larger margin, or you are matching an existing digest of that length. Never compare a digest from one algorithm with a digest from the other: different lengths always mean different algorithms, and the comparison is meaningless.

Can two different inputs produce the same SHA-256 hash?

In principle, yes: there are far more possible messages than the 2 to the power of 256 possible digests, so collisions must exist. In practice, finding one is out of reach: the birthday bound puts a random collision search at about 2 to the power of 128 tries, and no practical collision attack against SHA-256 is known. Collision resistance — that finding two colliding inputs is computationally infeasible — is the property the standard designs for. The contrast is SHA-1, where collisions have been demonstrated, which is why SHA-1 is legacy-only.

Why does changing one character change the whole hash?

Because the algorithm mixes every input bit through the whole digest, a small input change produces, with very high probability, a digest with no visible relation to the original — the avalanche effect. Hashing abc and abd, which differ in one letter, gives digests that differ in 58 of their 64 characters, with no visible pattern in the matches. That single comparison illustrates the effect; it does not by itself statistically establish the avalanche property. That behaviour is deliberate: if small input changes produced predictably small digest changes, an observer could predict new digests from old ones, weakening tamper detection.

Is SHA-256 still secure?

Yes. SHA-256 remains an approved algorithm under FIPS 180-4, which NIST still lists as a final standard, and no practical preimage or collision attack against it is known. The planned revision of the standard is aimed at SHA-1, not SHA-256: NIST decided in 2023 to revise FIPS 180-4 to remove the SHA-1 specification, and announced that SHA-1 should be phased out by 31 December 2030, with the revision to be published as FIPS 180-5. SHA-256's standing is unaffected by that change. The hashes to avoid for security work are the older ones: SHA-1 is no longer collision-resistant and carries a vulnerability warning in the browser documentation, and MD5 is broken for collision resistance and is not offered by the Web Crypto API. The practical risks with SHA-256 are not in the algorithm but in how it is used — hashing passwords with it alone, or trusting a checksum from an untrusted source.

What is SHA-256 used for besides verifying downloads?

Fingerprinting and content addressing, where systems store and retrieve data by its digest, which makes it possible to recognize identical content and detect corruption on read — whether a given system stores only one copy of identical content is its own design choice; cache keys and change detection, where equal digests mean, with very high probability, unchanged data; and as a building block inside keyed constructions such as HMAC and digital signatures, which add the authentication a bare hash cannot provide. It is also the standard test-vector hash: the digest of abc is the value developers use to confirm a new implementation is correct.

Why is a SHA-256 hash always 64 characters?

Because the digest is always 256 bits, and each hexadecimal character encodes 4 bits: 256 divided by 4 is 64. The length is fixed by the algorithm, not by the input — the empty string hashes to a full 64-character digest, just as a long document does. The digest itself is 32 bytes; the 64-character string is the conventional hexadecimal display of those bytes, and length is the fastest check that you generated the algorithm you meant to.

More guides on the QuikTools Hub blog.