PDF & image

How to Generate and Compare SHA File Checksums

Hash text or files with Web Crypto, copy hex or base64 and compare checksums. Follow two examples and understand byte differences, memory limits and MD5.

By the Criza Labs team · Updated · 5 min read

Key takeaways

  • A digest depends on exact bytes, including whitespace and line endings.
  • Hex and base64 represent the same digest; compare using the same algorithm.
  • MD5 is not offered by Web Crypto, and a checksum is not encryption or an identity check.

The hash generator calculates a digest from text or a file using the browser’s Web Crypto implementation. Choose SHA-1, SHA-256, SHA-384 or SHA-512, then copy the hexadecimal or base64 result. An optional comparison field checks whether a supplied expected checksum agrees with the generated digest.

Use a checksum when you need to compare exact content, such as checking a downloaded file against a trusted published value. The algorithm and the input bytes must both match. A visually identical document or a text file with different line endings can produce a different digest because hashing operates on bytes rather than visual appearance.

Before you start

Find the expected algorithm and checksum, if you are checking a download. A SHA-256 digest cannot be compared meaningfully with a SHA-512 value. Obtain the expected value from a trusted source associated with the file. A checksum copied from the same untrusted location as an altered file does not independently establish authenticity.

Choose whether you want text bytes or file bytes. Text mode encodes the entered characters as UTF-8. File mode reads the file exactly as stored, without interpreting its content as text. If you need to verify a downloaded archive, image or PDF, use file mode rather than pasting a visible excerpt into the text box.

The available algorithms come from Web Crypto’s digest support. MD5 is not offered, and the tool does not rename another algorithm to imitate it. SHA-1 remains available for legacy checksum compatibility, but avoid choosing it for a new security design. The Web Crypto specification defines the browser operations used here; checked 16 November 2026.

Step by step with CrizaTools

  1. Open Hash Generator and choose Input type as Text or File.
  2. Choose Algorithm, matching the source of any expected checksum.
  3. Enter Text to hash, or choose a File to hash within the displayed limit.
  4. Press Generate hash. Wait for the calculation to finish; hashing is an explicit action rather than an automatic operation on every keystroke.
  5. Read Hex and Base64, which are two representations of the same digest bytes. Use the corresponding copy button.
  6. Paste an expected hex or base64 value into Expected checksum. Read Match or No match below the result.
  7. If you change the text, file, input type or algorithm, generate again. The old result is cleared so it cannot be confused with the new input.

The expected-value field is different: changing it compares another value with the existing digest and does not require rehashing the input. Leading and trailing whitespace are ignored. Hexadecimal comparison ignores letter case, while base64 comparison is case-sensitive. Internal spaces are not removed automatically.

Two worked examples

Example 1: SHA-256 of three text bytes. Select Text and SHA-256. Enter exactly abc, with no newline or surrounding spaces, and press Generate hash. The hexadecimal result is:

ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad

The base64 representation is ungWv48Bz+pBQUDeXa4iI7ADYaOWF3qctBD/YfIAFa0=. Paste either representation into Expected checksum and the tool reports a match. Uppercasing the hexadecimal letters still matches. Changing the case of letters in the base64 string can change its decoded bytes and must not be treated as equivalent.

Example 2: the empty text digest. Keep Text and SHA-256 selected, clear the text field completely and press Generate hash. Empty text is a valid input. Its hexadecimal digest is:

e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855

This is different from hashing one space or a newline. For a matching file-mode check, choose a truly zero-byte file and generate SHA-256. A file that looks blank in an editor may contain a line ending or byte-order mark, so inspect its actual size rather than assuming blank appearance means zero bytes.

Limits and what to watch for

Text input is limited to 10 MB and file input to 100 MB. Web Crypto digest consumes the complete input rather than streaming it through this interface. The browser therefore reads the file into memory, and processing can be slow or fail on a constrained device even below the maximum file limit. Choose a smaller file if the device cannot finish.

A digest is not encryption: there is no decryption button that recovers the input. It is also not a substitute for a password-storage design. Fast general-purpose digests and password-specific systems serve different purposes. For this tool, keep the task focused on content comparison and checksum representation.

A matching checksum shows agreement with the supplied expected value. It does not scan the file for malware, verify a publisher’s identity or guarantee that the expected value came from a trustworthy place. Check how the publisher distributes verification information and keep that provenance separate from the arithmetic comparison.

Text differences are particularly easy to miss. A trailing newline, different Unicode content, a UTF-8 byte-order mark or Windows versus Unix line endings changes bytes. If a local command-line digest disagrees, compare input preparation and file selection before assuming the browser algorithm is wrong. File mode is the appropriate choice for exact downloaded-file verification.

Common mistakes

  • Comparing digests generated by different SHA algorithms.
  • Pasting a file’s visible contents instead of hashing the file itself.
  • Forgetting a trailing newline introduced by an editor or shell command.
  • Treating hex and base64 as different algorithms.
  • Expecting MD5 when the interface explicitly offers only SHA algorithms.
  • Reading a checksum match as a complete security review of the file.

Questions and answers

Why is MD5 absent from the algorithm menu?

This implementation uses Web Crypto digest algorithms, which do not include MD5. It offers the listed SHA choices honestly rather than providing an inaccurately labelled substitute. Use the algorithm required by the published checksum.

Does a filename affect its file checksum?

The tool hashes the selected file’s bytes, not its filename. Renaming without changing content therefore leaves the digest unchanged. An application that rewrites the file during a save operation may change its bytes even when the displayed content looks similar.

Can empty text be hashed?

Yes. An empty byte sequence has a defined digest for each supported algorithm. That makes an empty field a valid input, distinct from a field containing one or more invisible whitespace characters.

Why does uppercase hexadecimal still match?

Hex digits A–F and a–f represent the same values, so the comparison ignores their case. Base64 uses uppercase and lowercase letters as distinct symbols and is compared exactly after trimming surrounding whitespace.

Does changing the expected value require another calculation?

No. The expected field compares against the existing digest. Changing the actual input or algorithm does clear the digest and requires Generate hash again, keeping the result tied to the bytes and algorithm that produced it.

Sources

Calculate with Hash Generator and use UUID Generator when you need a new random identifier instead of a content digest.

Free tools for this

PDF & image

UUID Generator

Generate up to 1000 random version 4 UUIDs with crypto.randomUUID. Choose uppercase, remove hyphens or add braces, then copy all or download a text file.

PDF & image

Split PDF

Extract page ranges from a PDF into one document or save each selected page separately.

More guides

Free desktop app from Criza Labs

Bill every day? Get CrizaVoise free

GST invoices, thermal receipts, stock and payments in one offline app for Windows, Linux and macOS. No subscription, no sign-up, no ads, and your data stays on your computer.

  • 58 mm and 80 mm thermal printing
  • UPI QR on every invoice, WhatsApp sharing
  • Open source (Apache 2.0), English, Hindi, Gujarati and more
The CrizaVoise dashboard with quick bill and new invoice buttons, stock alerts and sample figures