To get the SHA-1 hash of a file in PowerShell, run Get-FileHash -Algorithm SHA1 -LiteralPath '.\archive.zip' and copy the Hash value. The cmdlet reads the file's bytes and returns the digest in its Hash property, so you do not need to open or modify the file. If the path contains spaces, keep it in single quotes and use -LiteralPath so PowerShell treats it as a literal path. The Sha1 Hash Generator gives you a browser-based route: it hashes exact UTF-8 text or local file bytes, returns lowercase Hex and standard padded Base64, and does not send the selected file to the application server. That distinction matters because checksum mismatches are often caused by the wrong input mode or output representation, not by the hash algorithm itself. For a legacy download, archive catalog, or old integration that publishes SHA-1, calculate the digest from the exact downloaded file and compare every character with a reference obtained through a trusted channel. SHA-1 remains useful for that limited compatibility check, but it is collision-broken and must not be treated as proof of authorship or protection against deliberate tampering.

Calculate the file hash in PowerShell
- Open Windows PowerShell and move to the folder containing the file. For example, run Set-Location 'C:\Downloads\LegacyPackage', or use the full file path in the next command.
- Run Get-FileHash -Algorithm SHA1 -LiteralPath 'C:\Downloads\LegacyPackage\archive.zip'. Replace the example path with the path to your file.
- Read the Hash field in the result. If you need only the digest on one line, run Get-FileHash -Algorithm SHA1 -LiteralPath 'C:\Downloads\LegacyPackage\archive.zip' | Select-Object -ExpandProperty Hash.
- Compare the complete value with the SHA-1 reference supplied by the legacy system. Do not remove characters, spaces, or other formatting from the reference before comparing it.
PowerShell can also calculate the hash by supplying the file path directly, without first changing directories. Use the full path when automation runs from an unpredictable working directory. The broader Windows SHA-1 workflow covers related file-selection and verification considerations.
Generate the digest in Sha1 Hash Generator
- Choose file mode rather than text mode when the legacy system hashes a downloaded file. Select the exact file and do not rename, edit, resave, or convert it first if those actions could change its bytes.
- Choose a local file no larger than 100 MB. The browser reads and hashes the selected bytes locally, and the selected file is not sent to the application server.
- Click the generate control to calculate the SHA-1 digest. An empty text field is also a valid message, but it still requires an explicit generate action before a result appears.
- Copy the representation required by the consuming system: lowercase Hex or standard padded Base64. Both formats represent the same 20 digest bytes; Base64 is not a second hashing algorithm.
- Compare every character of the copied value with the trusted reference. For Hex, use the tool's lowercase form; for Base64, preserve all letters, digits, and padding exactly.
The 100 MB ceiling reflects the browser API requirement that the selected input be available as one byte buffer before digesting can complete. The tool is therefore not a streaming replacement for command-line processing of multi-gigabyte images. For a larger artifact, use a trusted local operating-system tool and verify both the requested algorithm and the exact byte sequence it receives.
Know exactly what gets hashed
SHA-1 operates on bytes, so the input mode determines the result. The distinction between visible text and file bytes is especially important when a legacy system expects one checksum but you calculate the other.
| Feature | Defined behavior | Why it matters |
|---|---|---|
| Text mode | Encodes the visible string as UTF-8 before hashing. | Accented letters, emoji, and non-Latin scripts can occupy several bytes, so visual length does not determine the hashed byte count. |
| File mode | Hashes the raw bytes exactly as read. | The filename, modification time, and browser MIME label are not included in the digest. |
| Lowercase Hex | Displays the 160-bit digest as exactly 40 hexadecimal characters. | Use this when the legacy download page or integration publishes a Hex checksum. |
| Padded Base64 | Displays the same 20 digest bytes as exactly 28 standard Base64 characters, including padding. | Use this when the consuming system expects Base64 rather than hexadecimal. |
| Whitespace and line endings | Spaces, line endings, and a final newline all participate in the hash. | Visually similar inputs can correctly produce different values. |
Do not normalize whitespace before generating a text digest unless the system that produced the reference did the same normalization. For a file, do not assume that two files with the same name contain the same bytes. The safest approach is to hash the artifact you actually received and compare that result with the reference obtained independently through a trusted channel.
Resolve a checksum mismatch
If the generated value does not match, check these points before assuming the file is damaged:
- Representation: Confirm that you are comparing Hex with Hex or Base64 with Base64. Base64 is case-sensitive, and hexadecimal letter case must be handled consistently.
- Input mode: A UTF-8 text digest does not necessarily match the digest of a file containing those visible characters.
- Line endings: Windows and Unix-style line endings contain different byte sequences.
- Whitespace: Leading or trailing spaces and a final newline can change the digest even when the text looks almost identical on screen.
- Unicode encoding: Text mode uses UTF-8; another encoding or a failed conversion can produce different bytes.
- File identity: A replacement download, edited archive, or file with the same filename can have different content.
- File size: For an input above the browser tool's 100 MB limit, calculate it with a trusted local operating-system tool instead.
When troubleshooting a close but incomplete match, follow the character-by-character file checksum comparison process. Checking the length, representation, and final character first often identifies a formatting mistake faster.
Treat SHA-1 as a legacy checksum, not a security guarantee
SHA-1 is defined by NIST FIPS 180-4. The algorithm pads the input, divides it into 512-bit blocks, and updates five 32-bit state words through eighty rounds per block. Its final state is 160 bits, represented by the 20 bytes encoded as Hex or Base64 by the tool.
Collision resistance is the crucial limitation. According to RFC 6194's SHA-1 security considerations, practical collision attacks can produce different content with the same SHA-1 digest. A matching value can help detect accidental transfer damage in a controlled legacy workflow, but it does not establish authorship or prove that an attacker could not have substituted colliding content.
Do not select SHA-1 for signatures, certificate decisions, password storage, adversarial file approval, or tamper protection. A plain SHA-1 digest is also not a password hash: fast general-purpose algorithms let attackers test guesses quickly, and this utility never adds a salt or derives a key. Password storage requires a salted, deliberately expensive password-hashing scheme such as Argon2id, scrypt, or bcrypt implemented by the account system. For new security-sensitive designs, use SHA-256 or SHA-512 when the protocol permits it.
Choose the workflow that matches the input
| Workflow | Input | Result | Best fit |
|---|---|---|---|
| PowerShell Get-FileHash | A local file | SHA-1 digest in the Hash property | A native Windows command-line file check |
| Sha1 Hash Generator text mode | Visible text encoded as UTF-8 | Lowercase Hex and padded Base64 | A legacy system that checksums an exact text string |
| Sha1 Hash Generator file mode | Raw bytes from a local file up to 100 MB | Lowercase Hex and padded Base64 | Browser-based file checksum matching with local processing |
Use the native PowerShell workflow when you need a direct Windows command or a file larger than the browser tool's limit. Use Sha1 Hash Generator when you prefer browser-based processing, need the standard lowercase Hex or padded Base64 representation, or need to hash an exact UTF-8 text string. If you control the consuming system, migrate its published reference to SHA-256 or stronger and distribute the new checksum over an authenticated channel.