Skip to content
koducathome

SHA-1 Hash Generator

Generate SHA-1 hashes of text or files for legacy systems and Git-style checksums — hex or Base64 — and check them against an expected value.

How to use this tool

Steps for using the Hash Generator.

  1. Type or paste text, or choose File to hash a file of up to 50 MB. SHA-1 is listed first; the other algorithms are shown below it for comparison.
  2. The digest updates as you type. Pick hex, HEX (uppercase) or Base64 to match the format you need.
  3. Click Copy next to SHA-1, or Copy all / Download for every digest.
  4. To check a download, paste its published checksum into Verify a checksum — the matching algorithm lights up green.

Example

SHA-1 of the classic test sentence

Text (UTF-8) — the Sample button
The quick brown fox jumps over the lazy dog
SHA-1 (hex)
2fd4e1c67a2d28fced849ee1bb76e7391b93eb12

Common use cases

  • Checking checksums published as SHA-1 by older download pages.
  • Working with systems that identify content by SHA-1, such as Git objects.
  • Matching values stored by legacy APIs.
  • Spotting accidental file corruption.

SHA-1 today: legacy checksums, not security

SHA-1 produces a 160-bit digest, written as 40 hexadecimal characters. It was the standard secure hash through the 2000s and is still used by Git object IDs, older TLS certificates and many legacy APIs.

SHA-1 is no longer collision-resistant. A practical collision — two different PDF files with the same SHA-1 — was published in 2017, and the attack has only become cheaper since. Browsers and certificate authorities stopped accepting SHA-1 certificates for that reason.

Use it where compatibility demands it, or as a checksum against accidental corruption. For new work, choose SHA-256 or SHA-512.

This page computes SHA-1 with the browser's Web Crypto API (crypto.subtle.digest), so text and files never leave your device.

Limitations

  • Not collision-resistant: don't rely on SHA-1 where an attacker could choose the input.
  • Git hashes a short header plus the content, so a plain SHA-1 of a file is not its Git object ID.
  • Files up to 50 MB.

Frequently asked questions

Is SHA-1 still safe to use?

Not for security. Practical SHA-1 collisions exist, so it shouldn't be used for signatures or certificates. It is still fine as a checksum when nobody is trying to fool you.

Why doesn't this match my Git commit or blob ID?

Git hashes blob <size>\0 followed by the content, not the content alone. Hash that exact byte sequence (or use git hash-object) to reproduce a Git ID.

How long is a SHA-1 hash?

160 bits — 40 hexadecimal characters, or 28 characters in Base64.

What should I use instead of SHA-1?

SHA-256 for most purposes, or SHA-512 if you want a longer digest. Both are available on this page.