Verify a file handoff with SHA-256

Compare exact file bytes across a download or transfer and trace the common reasons for a mismatch.

Privacy and Security2 min readPublished Last edited Automated editorial check:
On this page

Use a checksum when the sender and recipient need to establish that they have the same file bytes. Someone opening a file can confirm it looks plausible. A matching SHA-256 digest can also catch less visible changes, including line endings or metadata differences. Agree on the algorithm and which file is being checked before sending the digest.

Run a three-byte exercise

Download the checksum practice file. It contains the UTF-8 bytes for abc and has no line ending. The calculator’s Load sample button uses the same content. Run the tool and compare its output with ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad. A SHA-256 digest displayed as hexadecimal always has 64 digits. Letter case in a hex digest makes no difference to the represented bytes.

Make a copy of the file and rename it. The digest stays the same. Open another copy in a text editor, add a newline, save it and check again. The digest should change even though the visible letters did not. Some editors automatically add a newline when saving a file, which can explain unexpected differences in a text handoff.

Decide how the reference reaches the recipient

For a personal backup check, you can retain the original digest in a folder manifest and compare it after restoration. For a third-party download, obtain the expected digest through a source you already trust. If both the file and digest could have been replaced in the same untrusted channel, matching alone gives no independent assurance of who supplied the file.

Digest the object you intend to verify. A ZIP archive has its own bytes, distinct from each extracted file. Two ZIPs with apparently identical contents can also differ because entries were stored in a different order or carry different timestamps. If the recipient cares about each extracted file, retain one digest per file or a trusted manifest inside the handoff process.

Troubleshoot a mismatch

First confirm both people used SHA-256 and checked the same version. Compare file sizes in bytes. If sizes differ, verify you downloaded the real file rather than an access-denied page saved under the expected extension. Check whether a messaging service recompressed an image or whether a document was re-exported after its digest was recorded.

Do not switch to a weaker check just to make the handoff pass. Retrieve the file again using the agreed channel and compare against a trusted expected value. ByeGA4’s checksum tool bounds file size because the browser implementation reads a file into memory. For larger transfers, use a trusted streaming checksum utility in your operating system.

Reading and practice

Related guides

Search ByeGA4