Home › Developer Tools › SHA-1 Hash Generator

SHA-1 Hash Generator

Type or paste text to see its SHA-1 hash instantly, or drop files to get their SHA-1 checksums. Switch between hex and Base64, add a key for HMAC-SHA1, reproduce a Git blob ID, and compare against an expected hash. Everything runs locally in your browser.

Last updated:

0 characters · 0 bytes
Advertisement
Advertisement

How to use the SHA-1 Hash Generator

  1. Choose Text or Files. Type or paste text, or drop one or more files onto the box.
  2. Read the SHA-1 below the input: it updates as you type and appears as soon as a file is hashed.
  3. Pick the format: hex (40 characters, optionally uppercase) or Base64 (28 characters).
  4. Optional: tick HMAC-SHA1 and enter a key to sign a message, or Git blob hash to get the object ID Git would give the file.
  5. Paste an expected hash into the compare box to verify a download, then copy or download the result.

SHA-1 test vectors

Known values to check any SHA-1 implementation (FIPS 180-4 examples and common references). Type the input above without the quotes.

InputSHA-1
"" (empty string)da39a3ee5e6b4b0d3255bfef95601890afd80709
"abc"a9993e364706816aba3e25717850c26c9cd0d89d
"abc" as Base64qZk+NkcGgWq6PiVxeFDCbJzQ2J0=
"The quick brown fox jumps over the lazy dog"2fd4e1c67a2d28fced849ee1bb76e7391b93eb12
HMAC-SHA1, key "key", same sentencede7c9b85b8b78aa6bc8a7a36f70a90701c9db4d9
Git blob of an empty filee69de29bb2d1d6434b8b29ae775ad8c2e48c5391

How SHA-1 works

SHA-1 pads the message with a 1 bit, zeros and the 64-bit message length so that it fills whole 512-bit blocks. Each block is expanded into 80 32-bit words, and 80 rounds of rotations, additions and the bitwise functions Ch, Parity and Maj mix them into five 32-bit state words (A to E). After the last block the five words, written one after another, are the 160-bit hash.

A Git blob ID is simply SHA-1("blob " + size + "\0" + content). That is why git hash-object gives a different value from sha1sum for the same file.

SHA-1 on the command line

TaskCommand
Hash a file (Linux)sha1sum file.zip
Hash a file (macOS)shasum -a 1 file.zip
Hash a file (Windows PowerShell)Get-FileHash file.zip -Algorithm SHA1
Hash a file (Windows cmd)certutil -hashfile file.zip SHA1
Hash text without a newlineprintf '%s' 'abc' | sha1sum
Git object ID of a filegit hash-object file.txt
HMAC-SHA1 with OpenSSLprintf '%s' 'message' | openssl dgst -sha1 -hmac 'key'

Frequently asked questions

What is SHA-1?

SHA-1 (Secure Hash Algorithm 1) is a hash function published by NIST in 1995 and specified in FIPS 180-4. It turns any input into a 160-bit value, usually written as 40 hexadecimal characters. For example, the SHA-1 of "abc" starts with a9993e36 (the full value is in the test vectors table below).

Is SHA-1 still secure?

Not against collisions. In 2017 the SHAttered attack produced two different PDF files with the same SHA-1, and later chosen-prefix attacks made collisions cheaper still. Do not use SHA-1 for digital signatures or certificates. It is still fine as a checksum to detect accidental corruption, for legacy compatibility, and inside HMAC-SHA1, which is not broken by these collision attacks.

Why is my SHA-1 different from another tool?

The hash covers every byte. This tool hashes text as UTF-8 exactly as typed. A trailing newline (echo adds one), Windows CRLF line endings, extra spaces or a different text encoding all change the result. Use printf '%s' instead of echo on the command line to avoid the newline.

How does Git use SHA-1?

Git names each object by the SHA-1 of a header plus the content. For a file (blob) that is the text "blob ", the size in bytes, a zero byte and then the content. Tick Git blob hash to get the same value as git hash-object. An empty file gives the blob ID that starts with e69de29b.

What is HMAC-SHA1?

HMAC-SHA1 combines a secret key with SHA-1 (RFC 2104) to authenticate a message. It is used by OAuth 1.0 signatures, many webhook signatures and the TOTP codes of authenticator apps (RFC 6238). HMAC-SHA1 is still considered secure because its security does not rely on SHA-1 collision resistance.

How do I get a SHA-1 checksum on my computer?

On Linux run sha1sum file, on macOS run shasum file (SHA-1 is the default) or shasum -a 1 file, and in Windows PowerShell run Get-FileHash file -Algorithm SHA1. The Command Prompt tool certutil -hashfile file SHA1 works too.

Are all the tools on FreeToolCabin tested for quality and accuracy?

Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.

Related tools

SHA-512 Hash GeneratorSHA-512 and SHA-384 hashes of text or files in hex or Base64, HMAC and hash verification.SHA-256 Hash GeneratorSHA-256 and HMAC-SHA256 hashes of text, lines or files, in hex or Base64.MD5 Hash GeneratorGenerate MD5 hashes of text, lines or files and verify checksums.Hash GeneratorGenerate MD5, SHA-1, SHA-256 and SHA-512 hashes of text or files.Pwned Password CheckerCheck if a password appeared in data breaches; only 5 characters of its SHA-1 hash are sent.Password GeneratorCreate strong passwords and passphrases.Base64 Encoder DecoderEncode or decode Base64 text and files, and make data URIs.URL Encoder DecoderPercent-encode or decode URLs, query strings and form data.HTML Entity Encoder / DecoderEscape and unescape HTML entities, named or numeric.Bcrypt Hash Generator & CheckerCreate bcrypt password hashes and check a password against a hash.Binary TranslatorConvert text to binary, hex, octal and back.HMAC GeneratorGenerate and verify HMAC signatures with SHA-256, SHA-512, SHA-1 or MD5.CRC32 Checksum CalculatorCalculate CRC-32, CRC-32C, CRC-16 and Adler-32 checksums of text or large files.JWT DecoderDecode JSON Web Tokens, read the claims and expiry, and verify HS256 signatures.JWT GeneratorCreate and sign HS256, HS384 or HS512 JSON Web Tokens in your browser and verify them.Password Strength CheckerSee how strong a password really is, how long it takes to crack and how to improve it.Caesar CipherEncode and decode Caesar shift ciphers and crack unknown shifts with a ranked brute force.Vigenère CipherEncrypt and decrypt Vigenère and Autokey ciphers, and crack unknown keys with frequency analysis.Atbash CipherEncode and decode Atbash ciphers (A↔Z, B↔Y) in Latin or Hebrew, with a live letter mapping table.ASCII TableFull ASCII code chart 0–255 in decimal, hex, octal, binary and HTML, with search and copy.Unicode Character LookupFind Unicode characters by name or code point and copy them with UTF-8, HTML and code escapes.Punycode ConverterConvert international domain names, emails and URLs between Unicode and xn-- Punycode, in bulk.JSON Escape / UnescapeEscape text for a JSON string, unescape \n and \" back to text, or stringify a whole object.Binary to HexConvert binary to hex instantly with steps and signed mode.Hex to BinaryConvert hex to binary instantly with steps and signed mode.Binary CalculatorAdd, subtract, multiply, divide, AND, OR, XOR and shift binary numbers with decimal values.Hex CalculatorHexadecimal + − × ÷ and AND, OR, XOR, NOT, shifts with decimal and binary equivalents.Base32 Encoder / DecoderEncode and decode Base32 (RFC 4648), Base32hex, Crockford and z-base-32 from text, hex or files.Base58 Encoder / DecoderEncode and decode Base58 and Base58Check (Bitcoin alphabet) from text or hex, with checksum verification.Unicode Escape / UnescapeConvert text to \uXXXX, \u{...}, \x, &#...; or CSS escapes and decode them back.File Hash CheckerGet MD5, SHA-1, SHA-256 and SHA-512 checksums of files and verify them against a hash.TOTP GeneratorGenerate 2FA one-time codes from a secret key, create otpauth QR codes and verify codes.RSA Key GeneratorGenerate 2048, 3072 or 4096-bit RSA key pairs as PEM, PKCS#1, JWK or OpenSSH, locally.SSL Certificate DecoderDecode PEM SSL/X.509 certificates: subject, issuer, expiry, SANs, key and fingerprints.Text Encryption ToolEncrypt and decrypt text with a password using AES-256-GCM, entirely in your browser.Argon2 Hash GeneratorHash passwords with Argon2id, Argon2i or Argon2d and verify them against an encoded hash.Base64 to PDFDecode a Base64 string to a PDF with preview and download, or encode a PDF to Base64.Bitwise CalculatorCalculate AND, OR, XOR, NOT and bit shifts at 8–64 bits with a bit grid and all bases.SRI Hash GeneratorCreate Subresource Integrity hashes (sha256/384/512) and ready <script> or <link> tags.SSH Key GeneratorGenerate Ed25519 or RSA SSH key pairs in your browser: OpenSSH public key plus private key.String Escape / UnescapeEscape or unescape strings for JavaScript, Java, C#, Python, C, SQL, regex, CSV and shell.UTF-8 Encoder / DecoderConvert text to UTF-8 bytes in hex, decimal, binary, \x or % and decode bytes back to text.UUID Decoder & ValidatorDecode any UUID: version, variant, v1/v6/v7 timestamp and MAC node, plus bulk validation.Base64 to FileDecode Base64 or a data URI to a downloadable file; detects the real file type and previews it.File Encryption ToolEncrypt and decrypt any file with a password using AES-256-GCM, entirely in your browser.Passphrase GeneratorMake strong, memorable diceware passphrases from a 7,776-word list, with entropy in bits.CSR DecoderDecode a PEM certificate signing request: subject, SANs, key size, signature and CA readiness checks.Enigma Machine SimulatorEncrypt and decrypt with a virtual Enigma I, M3 or M4: rotors, rings, plugboard and lampboard.Hex Opacity CalculatorConvert opacity percent to a 2-digit HEX alpha code and full #RRGGBBAA color, with a 0-100% table.Playfair CipherEncrypt and decrypt Playfair ciphers from a keyword, with the 5x5 key square and every digraph step.RSA Encryption ToolEncrypt text with an RSA public key and decrypt it with the private key using RSA-OAEP in your browser.SAML DecoderDecode SAMLRequest and SAMLResponse messages to readable XML, attributes and validity times.SSL Certificate ConverterConvert SSL certificates and keys between PEM, DER, PFX/P12 and P7B in your browser.Checksum CalculatorCompute 8-bit sum, two's complement LRC, XOR/BCC, NMEA, Fletcher and Internet checksums of bytes.PBKDF2 Hash GeneratorDerive PBKDF2 keys from a password, salt and iteration count with SHA-1, SHA-256 or SHA-512.Protobuf DecoderDecode raw Protocol Buffers hex or Base64 without a schema, or add a .proto for field names.XML Escape / UnescapeEscape & < > " ' for XML text and attributes, unescape entities back, or wrap text in CDATA.Binary Search Tree VisualizerInsert, delete and find in BST, AVL and red-black trees with animated rotations and traversals.CSR GeneratorCreate a certificate signing request (CSR) and private key with SANs, RSA or ECDSA, in your browser.MongoDB ObjectId to TimestampDecode a MongoDB ObjectId to its creation date, or build ObjectIds from dates for range queries.PGP Encrypt / DecryptEncrypt, decrypt, sign and verify PGP messages with your armored keys, entirely offline.PGP Key GeneratorGenerate an OpenPGP key pair (Curve25519, NIST ECC or RSA) with passphrase and expiry, offline.Quoted-Printable Encoder / DecoderEncode or decode quoted-printable email text (MIME) with UTF-8 and 76-character soft line breaks.Self-Signed Certificate GeneratorCreate a self-signed SSL certificate and key for localhost or dev servers, as PEM or PFX.
See all 65 Encoders, Hashes & Crypto →