SHA1 Generator

SHA-1 hashes of text or files, in hex or Base64, with a checksum compare box.

SHA1 Generator tool

Input

0 characters ยท 0 bytes (UTF-8)

SHA-1 (hex)
SHA-1 (Base64)

About the SHA1 Generator

SHA-1 checksums still appear on older downloads, in Git object IDs and in legacy systems. This SHA1 generator calculates the 40-character hash of text as you type or of any file you choose, in hexadecimal and Base64, and compares it with a checksum you paste: hello gives a hash beginning aaf4c61ddcc5e8a2. SHA-1 is no longer considered secure against deliberate attacks, so use it only for compatibility.

SHA-1 produces a 160-bit fingerprint of its input: change a single letter or byte and the hash changes completely. It is still widely used to identify content, for example Git commit and object IDs, older download checksums and many legacy systems, so being able to calculate it quickly remains useful when you need to check a value against one you were given.

SHA-1 is no longer considered secure against deliberate attack, because researchers have produced different files with the same SHA-1 hash. Do not use it for signatures, certificates or passwords; use SHA-256 or SHA-512 for new work. The calculation uses your browser's built-in Web Crypto implementation, and nothing is uploaded.

For stronger hashes, use the SHA-256 generator or the SHA-512 generator. To sign a message with a secret key, try the HMAC generator, and for older checksums, the MD5 generator. Every result updates as you type, and large files are hashed on your own device without ever being uploaded.

How to use the SHA1 Generator

  1. Choose the inputPick Text to hash typed text, or File to hash a file from your device.
  2. Enter the dataType or paste text, or choose a file. The hash appears immediately.
  3. Pick the formatChoose lowercase or uppercase hex; Base64 is shown too.
  4. Compare or copyPaste a known checksum to compare, or copy the hash.

SHA1 Generator features

  • SHA-1 of text or files
  • Lowercase or uppercase hex
  • Base64 output
  • Live update as you type
  • Compare with a known checksum
  • UTF-8 text handling, with byte count
  • Uses the browser's Web Crypto
  • Nothing is uploaded

Common uses

  • Checking a download against a published SHA-1 checksum
  • Understanding Git object and commit IDs
  • Matching values stored by legacy systems
  • Detecting changed files by comparing fingerprints
  • Teaching how hash functions behave

SHA-1 in practice: breached password checks, why Git hashes differ, authenticator codes, certificates and migrating to SHA-256

By the FreeToolsWorld editorial team · Updated November 2026 · How we write and check our guides

SHA-1 is broken for signatures and certificates, yet it still appears in tools developers use every day, from Git to two-factor authentication apps. Knowing where it remains acceptable, and where it must be replaced, avoids both needless panic and real risk. This guide shows how breached-password checks use SHA-1 safely, explains why Git's hash of a file differs from a plain SHA-1 of the same file, and covers authenticator codes, certificates and migration.

A worked example: checking breached passwords

The SHA-1 of the word password is 5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8. The Pwned Passwords service, which lists passwords exposed in data breaches, lets a website check a password using only the first five characters of its SHA-1 hash, here 5BAA6. The service returns every breached hash starting with those characters, and the website compares them locally, so the full hash never leaves the site. Many sign-up forms use this to reject passwords that appear in breaches.

Use sample words, not your real passwords, when experimenting with any hashing tool.

Why Git's hash differs

Git identifies a file's contents by a SHA-1 hash, but it hashes a short header before the content: the word blob, the file's size in bytes and a null character. For a file containing hello and a newline, Git's ID is ce013625030ba8dba906f756967f9e9ca394464a, while a plain SHA-1 of the same bytes is f572d396fae9206628714fb2ce00f72e94f2258f. The command git hash-object followed by a file name shows the Git form.

Authenticator codes

The six-digit codes in authenticator apps are usually produced with HMAC-SHA1 by default. This remains considered secure, because HMAC's security does not depend on the collision resistance that broke SHA-1 for signatures. Some services choose SHA-256 for their codes, but there is no urgent need to replace existing SHA-1-based codes.

Certificates and signatures

Browsers stopped trusting SHA-1-signed website certificates years ago, and code-signing and document-signing systems have moved to SHA-256 or stronger. If any system you manage still signs with SHA-1, it should be migrated, because practical collision attacks allow forged documents with valid-looking signatures.

Checking older downloads

Some older software archives list only SHA-1 checksums. A matching value confirms the file was not damaged in transfer. If you need assurance against deliberate tampering and the publisher offers SHA-256 or SHA-512 values or signed checksum files, use those instead.

Migrating to SHA-256

Replacing SHA-1 identifiers is usually done gradually. SHA-1 values are 40 hexadecimal characters while SHA-256 values are 64, so database columns, file names and validation rules need widening. Storing both hashes during the transition lets old references keep working while new data uses the stronger algorithm.

Different forms of the same hash

A SHA-1 digest is 20 bytes, written as 40 hexadecimal characters or 28 Base64 characters. Upper and lower case hexadecimal represent the same value. When comparing hashes from different tools, normalise the case and make sure both are in the same form before concluding that they differ.

Common mistakes

  • Using SHA-1 for new signatures or certificates.
  • Comparing a plain SHA-1 with a Git object ID.
  • Panicking about HMAC-SHA1 authenticator codes, which remain sound.
  • Forgetting to widen database columns when moving to SHA-256.

Related tools

To compare several algorithms at once, use Hash Generator. For quick error-detecting checksums, try CRC32 Checksum, and to encode binary values as text, Base64 Encoder.

Git and collisions

Since 2017, Git has used a hardened SHA-1 implementation that detects the known collision technique and refuses suspicious objects. Newer versions of Git can also create repositories that use SHA-256 throughout, although most repositories and hosting services still use SHA-1. For everyday work, Git's use of SHA-1 is not something users need to change.

Short hashes

Git usually shows commit IDs abbreviated to their first seven or so characters, which are enough to identify a commit in most repositories. As a repository grows, Git automatically lengthens abbreviations when needed to keep them unique. Scripts and documentation that need to stay valid for years should store the full 40-character hash.

Older API signatures

Some older APIs sign requests with HMAC-SHA1, including the OAuth 1.0a standard still used by some services. Because HMAC does not rely on collision resistance, these signatures remain workable, and you may need SHA-1 to integrate with such services. New APIs you design yourself should use HMAC-SHA256 instead.

Deduplication

Some backup and storage tools identify content by its SHA-1 hash to store identical files only once. For files you create and control, this is reliable. Where untrusted users can upload files, a determined attacker could craft two different files with the same SHA-1, so systems handling untrusted uploads should use SHA-256 for this purpose.

Hashing in scripts

In Python, hashlib.sha1(data).hexdigest() returns the hexadecimal digest, and in Node.js, crypto.createHash('sha1').update(data).digest('hex') does the same. Comparing a script's output with this tool, using the same sample text, quickly confirms that your code encodes text the same way before you rely on it for real data.

Privacy

Hashing uses your browser's built-in Web Crypto. Text and files are processed on your device and never uploaded.

Frequently asked questions

What is SHA-1?

SHA-1 is a cryptographic hash function that turns any input into a 160-bit value, written as 40 hexadecimal characters. The same input always gives the same hash, and a tiny change in the input gives a completely different hash.

Is SHA-1 still safe to use?

Not for security. Researchers have created collisions, two different files with the same SHA-1 hash, so it must not be used for signatures, certificates or passwords. It is still fine for non-security uses like detecting accidental changes.

Why does my hash differ from another tool's?

Usually because the input differs: a trailing newline, spaces, or a different text encoding such as UTF-16. This tool hashes your text as UTF-8 exactly as typed. For files, the bytes are hashed exactly as stored.

How do I check a file's SHA-1 checksum?

Switch to File, choose the file, then paste the published checksum into the compare box. The tool tells you whether they match, ignoring letter case and spaces.

Does Git use SHA-1?

Yes. Git identifies commits, trees and files by SHA-1 hashes of their content with a small header, so a Git blob ID differs from the plain SHA-1 of the file. Newer Git versions can also use SHA-256.

Can SHA-1 be reversed?

No. Hashes are one-way. Short or common inputs can be guessed by trying many values, which is why hashes of simple passwords are easy to crack, but the hash itself cannot be decoded.

Is my data uploaded?

No. Everything is calculated by code running in this page on your own device. Your text, files and keys are never uploaded, stored or logged, so it is safe to use with private data.

How long is a SHA-1 hash?

A SHA-1 hash is always 160 bits long, which is 20 bytes. Written in hexadecimal that is 40 characters, and in Base64 it is 28 characters ending with a single equals sign, whatever the size of the input.