Trailing Space Changes Hash – Hidden Whitespace Check

Local only

Show that a trailing space changes the hash even when it is hard to see.

6 chars · 1 line

Waiting for input

Loading hash algorithms…

Whitespace and hashes

Can a trailing space cause a hash mismatch?

Yes. A space after the visible word is still part of the input. Hash output changes even when the text appears identical in a UI that hides trailing whitespace. This tool is free to use. No account or payment is required.

Last updated

What you can do here

  • MD5 text digests
  • SHA-1 text digests
  • SHA-256 text digests
  • SHA-512 text digests
  • Exact text byte sensitivity
  • Browser-local hashing

Steps

  1. Inspect the end of the source text.
  2. Compare its length with the expected value.
  3. Remove trailing whitespace only when canonicalization requires it.

Trailing whitespace is data

A trailing space contributes one byte in UTF-8. Hash functions do not distinguish visible content from formatting; they process the bytes they receive.

Trailing-space SHA-256 comparison

The first value ends with one ordinary space.

Input comparison

hello␠
hello

SHA-256 digests

trailing space: 5e3235a8346e5a4585f8c58562f5052b8fe26a3bb122e1e96c76784964dfc461
plain: 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824

Common questions

Frequently asked questions

Is trailing whitespace ignored by SHA-256?

No. SHA-256 receives bytes; a trailing space changes the byte sequence.

How can I find a hidden trailing space?

Use an editor that renders whitespace or compare the source string length before hashing.

Debugging a specific Hash issue? Browse Hash troubleshooting.