SHA Hash Generator

SHA digests, in the format you need.

Format

SHA digests, in the format you need.

How to use it

  1. Paste the text. It is hashed as UTF-8 bytes, so accents and emoji work.
  2. Pick the algorithm. SHA-256 unless something specifically requires another.
  3. Pick the format. Hex for most things, Base64 for headers, colons for fingerprints.

When you would use this

A hash is only useful if it agrees with everyone else's, so the interesting question about a hash tool is not whether it works but whether it matches. This uses the browser's own crypto implementation rather than a hand written one. Writing SHA-256 in JavaScript is a few hundred lines and would be slower, unaudited, and wrong in ways that would go unnoticed for months. Every digest here is checked against OpenSSL in the tests, across four algorithms and inputs including accented text and emoji. The text is hashed as UTF-8 bytes. That sounds obvious and is where implementations working on code units quietly diverge on anything that is not ASCII. Three output formats are offered because they are genuinely used for different things: hex for most purposes, Base64 for HTTP headers such as subresource integrity, and the colon separated form for fingerprints. The Base64 is of the digest bytes rather than of the hex string, which is the version everything else agrees with. MD5 is absent deliberately rather than by oversight. See the questions below.

Questions

Where is MD5?
Not here. The browser's crypto does not implement it, and it is broken for anything security related. Offering it beside SHA-256 with no explanation invites people to pick the one they recognise. If you need MD5 to verify an old download checksum, that is a file comparison rather than a text hash and it is a separate tool.
Why is SHA-1 offered if it is broken?
Because checking a value someone else produced is a real need, and git and older systems still use it. The result says it is broken, every time, so nobody picks it for something new by accident.
Is the Base64 output of the hash or of the hex?
Of the raw digest bytes, which is the correct answer and what every other tool produces. Encoding the hex string instead is a common mistake and gives a value twice the length that nothing else recognises.