gettoolz.app

SHA-1 hash generator

SHA-1 produces a 160-bit digest, 40 hex characters — the length of a Git commit ID, because that is what Git computes with it. Computed in your browser: the text you type is never sent anywhere.

Part of developer tools and security tools.

Text to hash

SHA-1

waiting for input…

MD5

waiting for input…

SHA-256

waiting for input…

SHA-512

waiting for input…

Good to know about SHA-1

Designed by the NSA and standardised by NIST in 1995, SHA-1 held out far longer than MD5, but a first public collision arrived in 2017 and a chosen-prefix one in 2020 (“SHA-1 is a Shambles”), cheap enough to forge PGP key certifications. Browsers stopped trusting SHA-1 certificates in 2017, and NIST has set the end of 2030 as the date to stop using it altogether.

Git is why you still meet it every day: an object ID is the SHA-1 of the object’s content behind a short header giving its type and size, so git hash-object on a file does not print the digest you get here for the same text. Git has used a collision-detecting variant since 2017, and a repository can now opt into SHA-256 object names instead.

SHA-1 reference hashes

Every digest below was computed by the same code as the generator above when this page was built, and checked against the value recorded in the site’s source — a mismatch stops the build. Inputs are hashed as UTF-8 bytes, with nothing added.

SHA-1 digests of common inputs
InputSHA-1Copy
(empty string)0 bytes. Zero bytes — also the digest of any empty file.da39a3ee5e6b4b0d3255bfef95601890afd80709
abc3 bytes. The test vector used in the algorithm’s own specification.a9993e364706816aba3e25717850c26c9cd0d89d
hello5 bytes. Just the five letters, as printf sends them.aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d
hello\n6 bytes. With the trailing newline that echo adds.f572d396fae9206628714fb2ce00f72e94f2258f
The quick brown fox jumps over the lazy dog43 bytes. The classic pangram.2fd4e1c67a2d28fced849ee1bb76e7391b93eb12
café5 bytes. The é is two bytes in UTF-8, c3 a9.f424452a9673918c6f09b0cdd35b20be8e6ae7d7

Getting the same digest on the command line

On Linux, printf %s hello | sha1sum prints aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d, the value in the table. The more natural echo hello | sha1sum gives f572d396fae9206628714fb2ce00f72e94f2258f instead, because echo appends a newline and the newline is hashed too. On macOS the command is shasum -a 1. When a digest will not match, a trailing newline or a text editor’s different encoding is the first thing to check.

Other algorithms

SHA-1 digests are 160 bits, 40 hex characters. The same text through the other algorithms:

Or open the hash generator with all four side by side. Either way the text stays in this tab — see the privacy page.