# Why Text and File SHA-256 Checksums Can Differ

https://ferkesh.net/uk/baza-znan/stattia/checksum-text-versus-file-byte-differences

A digest represents exact bytes. Two inputs that look alike can have different line endings, encodings or a byte-order mark. Use the publisher's trusted expected value to verify a download.

![Visible text: Same appearance; Exact bytes: Newline or encoding; Digest: Compare the trusted value.](https://ferkesh.net/kb-media/ferkesh-guide-diagrams-batch-16.svg#checksum-text-versus-file-byte-differences)

## Start with a synthetic pair

Compare pasted hello with a UTF-8 file containing hello and a final newline. Choose the same SHA-256 algorithm in the Ferkesh Checksum Generator for both. Text mode uses UTF-8 bytes. The saved newline changes the input, so the digest should differ.

## Find the byte difference

Use an approved editor or local tool that shows encoding and newlines. Check whether copying normalized line breaks or lost the end-of-file newline. Use the original file when validating a release and avoid editing it merely to match a digest.

## Record exact evidence

Save the algorithm, the exact file checked and the independent source of the expected digest. A match against an untrusted digest cannot establish authenticity. Repeat the comparison using the actual file when a pasted name or text sample is ambiguous.

## Related Ferkesh Knowledge Base guides

- [How to Verify a Backup Archive Checksum Before Restoring](https://ferkesh.net/knowledgebase/article/verify-backup-archive-checksum)
- [How to Find Case-Sensitive File Paths After a Linux Move](https://ferkesh.net/knowledgebase/article/linux-file-path-case-migration)

## Ferkesh Tools

- [Checksum Generator](https://tools.ferkesh.net/checksum-generator/)

## Official references

- [TextEncoder – MDN](https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder)

Last reviewed November 27, 2026.
