SHA-1 hash generator
Computes the SHA-1 digest defined in FIPS 180-4, the hash Git uses to name objects and one that older systems still ask for.
Loading the tool…
Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.
How to use it
- Enter text or bytes and input type.
- The result appears straight away and updates as you edit.
- Copy the result, or copy a link that keeps the same values to share it.
How it is calculated
The UTF-8 bytes are padded into 512-bit blocks; each block expands to 80 words and runs 80 rounds over five 32-bit registers, giving 160 bits.
Example
Inputs: Input type = Text (UTF-8). Result: SHA-1 digest (hex): a9993e364706816aba3e25717850c26c9cd0d89d; Input size: 3 bytes; Digest length: 160 bits.
abc
a9993e364706816aba3e25717850c26c9cd0d89d
Limits and caveats
- Practical SHA-1 collisions have existed since 2017, so use SHA-256 for signatures and certificates.
- The digest covers the text exactly as typed: a trailing space or newline changes it completely, and line breaks count as LF.
Questions about this tool
Is a Git object id just SHA-1 of the file content?
No, Git prepends a header such as blob and the size before the content, so its id differs from the hash of the text alone.
How many characters is a SHA-1 hash?
40 hex characters, because the output is 20 bytes and each byte takes two characters.
Is SHA-1 safe for storing passwords?
No, it is fast and easy to brute force. Passwords need a slow function such as bcrypt or Argon2.
