SHA-256 hash generator

Paste text and get its SHA-256. This is the digest to use when you have a choice: unbroken, universally supported, and the one under TLS certificates, Subresource Integrity and every package lockfile you have ever read. The work is done by your browser own cryptography, not by a script we wrote.

Result

The answer appears here as you type.

  • Where it runs

    Nothing is uploaded, because there is no file — it is worked out in this page.

  • No queue, no account

    It answers as fast as your machine can, and it never asks who you are.

  • As often as you like

    Nothing is counted and nothing is capped — answering again costs us nothing.

How it works

  1. Paste the text into the box. The digest appears as you type.
  2. Switch the case if the value you are comparing against uses the other one.
  3. Copy the sixty-four characters. Nothing left your machine.

The default answer, and why it earned that

SHA-256 has no known practical collision, no length-extension problem in the ways people usually use it, and hardware acceleration on essentially every processor made in the last decade. It is what certificates are signed with, what Subresource Integrity puts in a `integrity` attribute, what a package lockfile records, and what Bitcoin is built on.

None of that is an argument from popularity. It is an argument from scrutiny: an algorithm this widely deployed has had more attention paid to breaking it than any alternative, and it has held. Choosing something less common to be clever is how people end up with a primitive nobody has audited.

This one is the platform, not our code

The digest here comes from `crypto.subtle`, the browser own cryptography, which is implemented in the same native code that verifies certificates. The MD5 page is the exception on this site: it is written out, because the Web Crypto standard deliberately does not offer MD5.

That distinction is worth stating rather than glossing. A hash function implemented in JavaScript can be correct, and this site tests its one such implementation against RFC 1321 — but for anything that still has security properties, the right answer is the one the platform already ships and keeps patched.

A hash is not encryption, and it is not a secret

There is no key and nothing to reverse. A digest is a fingerprint: the same input always produces it, and a different input almost certainly does not. You cannot get the input back, and you also cannot hide the input by hashing it — anything guessable can simply be hashed by the attacker and compared.

This is the mistake behind a great many hashed email addresses and hashed phone numbers treated as anonymised data. There are only so many phone numbers; hashing all of them takes minutes. A hash anonymises nothing that comes from a small or enumerable set.

Where SHA-256 is still the wrong tool

Passwords, again and for the same reason as MD5: it is fast. Hardware acceleration makes it faster still, which is excellent for verifying a certificate and precisely wrong for resisting a guessing attack. Password storage wants bcrypt, scrypt or Argon2, all of which are deliberately slow and tunable.

Message authentication is the other one. Hashing a secret together with a message is a pattern with real pitfalls, and HMAC exists to avoid them — it is the construction to use, and `crypto.subtle` provides it. A plain digest of "key plus message" is a well-known way to get this wrong.

Comparing digests, and the two things that break it

Encoding first. This hashes UTF-8 bytes, and a system that stored the same text in another encoding produces a different digest for what looks like the same string. A trailing newline second — a file usually ends with one and a text box does not, which is enough to change every character of the result.

Both are worth checking before concluding that something is wrong, because a hash gives no partial credit. Two digests either match or share nothing, so there is no gradient to tell you that you are nearly right, and every near miss looks exactly like a total mismatch.

Reading the length as a diagnostic

SHA-256 is sixty-four hexadecimal characters, always, whatever the input. MD5 is thirty-two, SHA-1 is forty, SHA-512 is a hundred and twenty-eight. Counting the characters of a digest somebody handed you is the fastest way to find out which algorithm it came from when the documentation does not say.

It is also a quick check on a stored column. A field that is meant to hold SHA-256 and contains forty characters is holding SHA-1, and it is holding it because something upstream was never updated — which is a more common finding than it ought to be.

SHA-256 hash generator: common questions

Is SHA-256 secure?

For integrity and fingerprinting, yes — there is no known practical collision and it is what certificates, Subresource Integrity and package lockfiles all rely on. For password storage, no, and not because it is weak: it is fast, and password hashing needs an algorithm that is deliberately slow.

Can I get the original text back from a SHA-256?

Not by reversing it. But hashing does not hide anything that comes from a small set — an attacker who suspects your input can simply hash their guess and compare. Hashed email addresses and phone numbers are not anonymous for exactly this reason.

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

SHA-2 is the family and SHA-256 is a member of it, alongside SHA-224, SHA-384 and SHA-512. When documentation says SHA-2 without a number it almost always means SHA-256, since that is the one in general use.

Should I use SHA-512 instead?

There is no security reason to. It is faster on 64-bit hardware and produces a longer digest, but SHA-256 is unbroken and universally supported, and a longer hash is not a stronger guarantee against any attack that exists. Match whatever you are interoperating with.

Is my text uploaded?

No. The digest is computed by your browser own cryptography, in this page, and the network panel will show nothing carrying what you typed. The values people hash are frequently secrets or identifiers, which is exactly the category that should not travel.

Other tools