🌐 Blog

What is SHA-256 and what it is for (it is not encryption)

by Toolonium Team · · 8 min read

“I’ll hash the password” and “I’ll encrypt the password” are not the same thing, and confusing them causes real security mistakes. This guide explains what SHA-256 is, what properties it has, what it is really for, and why a hash is not encryption.

1. What a hash is

A hash function takes data of any size and produces a fixed-size fingerprint. A cryptographic hash function is additionally designed so that it is infeasible to reverse it or find two inputs with the same fingerprint.

2. What SHA-256 is

SHA-256 belongs to the SHA-2 family and produces a 256-bit fingerprint, shown as 64 hexadecimal characters:

e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855

(that is the hash of the empty string). The same input always gives the same output.

3. Properties

  • One-way: there is no way to “undo” the hash to recover the input.
  • Deterministic: the same input always produces the same hash.
  • Avalanche effect: changing a single bit of the input completely changes the fingerprint.
  • Collision-resistant: it is infeasible to find two different inputs with the same hash.

4. What it is for

  • Verify integrity: you publish the SHA-256 of a download; whoever gets it recomputes it and, if it matches, the file was not altered.
  • Store passwords: the hash is stored with a salt, never the plaintext password.
  • Digital signatures and blockchain: the hash is a core piece.

In all these cases the fingerprint is used, not an “encryption”.

Compute the SHA-256 of a text or file — processed 100% in your browser, nothing is uploaded → open the hash generator

5. A hash is not encryption

This is the most important distinction:

Hash (SHA-256)Encryption
Reversible?NoYes, with the key
GoalFingerprint / integrityConfidentiality
Recover the originalNeverYes

A hash cannot be decrypted because it does not store the original’s information: it summarizes it into a fingerprint. If someone says “SHA-256 encrypts”, they are misusing the term.

6. SHA-256 vs SHA-1 vs MD5

  • MD5 and SHA-1: have demonstrated collisions, must not be used for security.
  • SHA-256: no known practical collisions, the recommended standard today.

7. Relation to other identifiers

If you also generate unique identifiers, see what is a UUID v4: it solves a different problem (uniqueness, not integrity), but both are developer tools that run 100% in your browser.

8. Summary

SHA-256 is a cryptographic hash function from the SHA-2 family that produces a 256-bit fingerprint, one-way, deterministic and with an avalanche effect. It is used to verify integrity, store passwords with a salt, and underpin signatures and blockchain. It is not encryption: it cannot be decrypted. Compared with SHA-1 and MD5, which are broken for collisions, it is the current standard. To compute one locally, use the generator.

Frequently asked questions

What is SHA-256?

SHA-256 is a cryptographic hash function from the SHA-2 family that takes any data and produces a 256-bit fingerprint (64 hexadecimal characters). The same input always gives the same output, and it is infeasible to deduce the input from the fingerprint.

Is a hash the same as encryption?

No. Encryption is reversible: with the right key you recover the original. A hash is one-way: there is no operation to 'undo' it and recover the input. SHA-256 encrypts nothing; it produces a fingerprint that cannot be decrypted.

What is SHA-256 used for?

To verify the integrity of files and downloads (if the hash matches, the file was not altered), to store passwords together with a salt, and as a piece of digital signatures and blockchains. In every case the fingerprint is used, not an 'encryption'.

What is the avalanche effect?

It means a tiny change in the input (a single bit) produces a completely different fingerprint. Because of that, you cannot infer how similar two inputs are by comparing their hashes.

Why not use SHA-1 or MD5?

SHA-1 and MD5 have demonstrated collisions: two different inputs can be built with the same hash, which breaks their use in security. SHA-256 has no known practical collisions and is the recommended standard today.

Related articles

Back to blog