How to use it

  1. Type or paste the text. The hashes change as you type.
  2. Tick the algorithms you need. SHA-256 is ticked to start; MD5 and SHA-1 are there for older systems that still ask for them.
  3. To compare, paste a hash into Expected hash. The tool works out the algorithm from the length of the hash, calculates it if it is not ticked, and says whether the two match.

A file switches to hashing a file of any size, as the checksum calculator does.

Why your hash does not match another tool's

A hash changes completely when one byte of the input changes, so two tools agree only when they hash exactly the same bytes. The usual differences:

  • A line break at the end. echo writes a newline after its text (GNU coreutils), so echo abc | sha256sum hashes four bytes, not three. Use printf '%s' 'abc' or echo -n abc.
  • Spaces and line endings. A space at the end, or Windows line endings (CR LF) where this tool has LF, change the bytes. Line breaks typed here are hashed as LF.
  • The encoding. This tool hashes the text as UTF-8. Code that hashes it as UTF-16, such as .NET code using Encoding.Unicode, gives a different hash for the same characters.
  • Not a difference: upper or lower case in the hash. AB12 and ab12 are the same hexadecimal value, and the comparison here ignores case.

Hashing text on the command line

On macOS, and on Linux with sha256sum in place of shasum -a 256:

printf '%s' 'Hello world' | shasum -a 256

PowerShell has no command that hashes a string, but Get-FileHash hashes a stream, which is how Microsoft's own example does it:

$bytes = [Text.Encoding]::UTF8.GetBytes('Hello world')
Get-FileHash -InputStream ([IO.MemoryStream]::new($bytes)) -Algorithm SHA256

All three print this hash (PowerShell in capitals), as this page does for Hello world:

64ec88ca00b268e5ba1a35678a1b5316d212f4f366b2477232534a8aeca37f3c

Do not store passwords with SHA-256

SHA-256 and MD5 are built to be fast, which is right for checking files and wrong for passwords: whoever gets the hashes can try guesses quickly. OWASP's Password Storage Cheat Sheet says fast hashes such as SHA-256 are not suitable for password storage, and recommends Argon2id, or scrypt, bcrypt or PBKDF2 where Argon2id cannot be used, with a unique salt for each password.

MD5 and SHA-1

Both are broken as security tools: people have made two different inputs with the same hash, for MD5 (RFC 6151) and, in 2017, for SHA-1 (Google and CWI). They are offered because older systems and published values still use them. For anything new, use SHA-256 or SHA-512.

Your text stays on your device

The text is hashed in this browser tab, in a background worker, and no request carries it. Once the page has loaded it works with the connection off.