Use sha256sum /path/to/file in Linux to generate a file's SHA-256 digest as 64 hexadecimal characters.
The digest is calculated from the file's exact bytes. This makes it useful for confirming that a downloaded installer, archive, image, or release artifact matches an expected checksum. Linux provides the command-first workflow, while the SHA256 Hash Generator offers a local browser interface for checking file bytes without uploading them.

What the Linux command hashes
On typical Linux distributions, sha256sum comes from GNU coreutils. It reads the specified file and prints its SHA-256 digest in hexadecimal form together with the filename. The digest represents the file contents; the filename is included as context for identifying which file was processed.
- Exact bytes matter: Headers, metadata, line-ending bytes, trailing newlines, and hidden bytes are all part of the input.
- The path does not change the digest: Moving the same unchanged file to another directory normally leaves its SHA-256 value unchanged.
- The output is one-way: A SHA-256 digest does not encrypt the file and cannot be decoded to recover its contents.
This behavior makes SHA-256 suitable for file-integrity checks. It does not, by itself, prove who published a file or whether a checksum came from a trustworthy source.
Generate the file hash in Linux
- Identify the exact artifact. Open a terminal and either change to its directory or use its full path. Check the current location and filename before hashing. For example, run pwd and ls -l -- archive.tar.gz. This helps prevent a checksum for one release from being compared with a similarly named file from another release.
- Run sha256sum against the file. Use the filename in the current directory with sha256sum archive.tar.gz, or use a complete path such as sha256sum /tmp/downloads/archive.tar.gz. Quote paths that contain spaces, for example sha256sum "/tmp/downloads/My Release.tar.gz".
- Read the complete digest field. The output contains a 64-character hexadecimal SHA-256 value followed by the filename. Copy all 64 hexadecimal characters when the publisher expects only a digest. Do not compare only a prefix or a visually similar shortened value.
- Save a local checksum record if needed. Run sha256sum archive.tar.gz > archive.tar.gz.sha256 to store the digest and filename in a checksum file. Keep this record with your release notes or build artifacts. It is useful for later verification, although a checksum file downloaded from the same untrusted source does not make the file authentic.
- Verify the saved checksum. With the artifact and checksum file in the expected location, run sha256sum --check archive.tar.gz.sha256. The utility checks each digest in its checksum-file format and reports whether the corresponding file matches. A successful check confirms that the current file produces the recorded digest.
- Investigate any mismatch before using the file. A different digest may mean that the file changed, the wrong version was selected, or a transfer was incomplete. Recheck the path, size, line endings, and source rather than accepting a partial match.
Compare against a published checksum
When a project owner publishes a SHA-256 value, compare it with the complete digest produced by Linux. First confirm that the expected value actually came from an authenticated source, such as the project's official HTTPS download page or a signed release. Then ensure the value is a SHA-256 digest rather than a checksum for another algorithm.
If the publisher supplies a checksum manifest containing multiple files, keep the manifest in its published format and run sha256sum --check SHA256SUMS from a directory where the listed files are available. If only one digest is published, compare that 64-character value manually with the digest field from sha256sum.
Hex letter case does not change the underlying 32-byte digest, but the receiving program may expect a particular text format. A lowercase 64-character Hex value is the normal output of sha256sum. Use Base64 only when the workflow explicitly requests that representation.
Cross-check the same file in your browser
The SHA256 Hash Generator supports a local file workflow for files up to 100 MB. Calculation takes place in the current browser tab, and the application does not upload the selected content.
- Select file mode and choose the local file. Use file mode rather than pasting text into text mode. File mode bypasses text decoding and hashes every selected byte, including headers, embedded metadata, and line-ending bytes.
- Generate the digest. The generator produces the standard SHA-256 result for those bytes using the browser cryptography implementation.
- Copy the representation required by the other system. For comparison with Linux sha256sum output, copy the 64 lowercase hexadecimal characters. The tool also provides standard padded Base64, which is another representation of the same 32 digest bytes.
- Compare the entire value with an authenticated reference. Confirm that the Linux command and browser selected the same unchanged file. A complete Hex-to-Hex match supports the integrity conclusion; mismatched formats should not be compared line by line.
The browser's 100 MB cap is important. Its digest operation receives the complete byte buffer rather than a streaming input. For a much larger file, use a trusted streaming utility on the local machine instead of exhausting browser memory.
Why Linux and browser hashes can differ
A hash mismatch usually indicates different input bytes or a different displayed representation, not a broken SHA-256 implementation. Use this comparison to isolate the cause:
| Situation | Why results differ | Corrective action |
|---|---|---|
| Text was pasted into a hashing tool | Pasted text is encoded as UTF-8, while a file may contain a final newline or other bytes that were not pasted. | Select the file directly in file mode. |
| One source uses LF and another uses CRLF | Line endings are distinct bytes, even when the lines look the same. | Hash the same downloaded artifact in both systems. |
| Unicode appears visually identical | Different Unicode normalization forms can encode the displayed characters differently. | Compare file bytes rather than retyping the content. |
| A shell command supplied text | Commands such as echo can append a newline, creating a different input. | Pass the filename directly to sha256sum. |
| Hex is compared with Base64 | Both represent the same digest bytes, but their text forms differ. | Use the representation expected by the receiving system. |
| The file changed between checks | SHA-256 reflects the bytes present at the time of each operation. | Re-run both checks against the final, unchanged artifact. |
Choose the output format the receiver expects
The Linux command and browser tool can expose the same digest in different textual forms. Choose the form required by the checksum list, build system, or deployment workflow.
| Representation | Appearance | Typical use |
|---|---|---|
| Hex | 64 lowercase hexadecimal characters | Checksum files, command-line comparisons, and systems that explicitly request a hexadecimal SHA-256 value. |
| Base64 | Standard padded Base64 | Systems that request Base64-encoded digest bytes rather than hexadecimal. |
Hex and Base64 do not indicate different algorithms. They are two encodings of the same 32-byte SHA-256 result. Record the algorithm name, representation, and filename alongside a stored digest so a 64-character value is not later mistaken for another checksum format.
Treat a match as integrity evidence, not proof of origin
SHA-256 is defined in NIST FIPS 180-4. It is a one-way hash with no key, not encryption, and it cannot authenticate who created an input.
A matching digest is meaningful only when the expected digest is authentic. If an attacker can replace both a file and the checksum displayed beside it, recomputing SHA-256 will confirm the attacker's pair. Obtain reference hashes through HTTPS from the owner, through a signed release, or through another authenticated channel appropriate to the risk.
Use HMAC-SHA-256 when two systems share a secret and require message authentication. Use a digital signature when a verifier must establish origin with a public key. Do not store passwords by hashing them directly with SHA-256; account systems should use a unique salt and a purpose-built password hashing function with calibrated memory and time costs.
Handle large files and keep the final record
Keep the browser workflow within its documented 100 MB limit. For larger artifacts, a trusted local streaming tool on the Linux system is the appropriate choice. Run it against the completed release file, not an intermediate version that may still change.
For build and deployment workflows, generate the checksum after the final artifact is complete, store it with the filename and algorithm name, and verify the digest again immediately before transfer or release. If the Linux and browser checks are both used, re-run them if the artifact changes between checks. This preserves the meaning of the comparison: identical bytes on one side, an authentic expected digest on the other, and the complete digest compared without truncation.
For a deeper look, see SHA512 Hash Generator API Alternative: What It Supports.
For a deeper look, see SHA1 Hash Generator Bulk: What It Can and Cannot Do.