How to use the Verify Base64 tool
- Paste the encoded data into the Base64 or Base64 data URL box. Select Example to hash a short sample.
- Optionally paste the 64-character hex digest you expect into the Expected SHA-256 (optional) box.
- Select Verify to decode the value and compute its hash.
- Read the digest on the first line of the Result box. With an expected value, the second line says Match or Mismatch.
How to verify Base64 with a SHA-256 hash
The hash is computed over the decoded bytes, not over the Base64 characters. That choice makes the result independent of representation: padded or unpadded, standard or URL-safe, wrapped or on one line, the digest is the same. It is also the same value that sha256sum prints for the original file.
SHA-256, specified in FIPS 180-4, maps input of any length to a 256-bit digest, shown here as 64 lowercase hex digits. Changing a single bit of the input changes the digest completely. The calculation uses the browser's built-in Web Crypto API.
A worked example
The sample decodes to a 13-byte greeting. Its digest appears alone when the expected box is empty. With the same digest pasted into the expected box, the tool repeats the digest and adds Match on a second line.
Base64: SGVsbG8sIHdvcmxkIQ==
Bytes: Hello, world!
SHA-256: 315f5bdb76d078c43b8ac0064e4a0164612b1fce77c869345bfc94c75894edd3
With that digest as Expected SHA-256:
315f5bdb76d078c43b8ac0064e4a0164612b1fce77c869345bfc94c75894edd3
MatchFormat of the expected hash
The comparison is made against lowercase hex, after light cleanup of what you paste.
- Accepted: exactly 64 hex digits, in uppercase or lowercase, with spaces around them trimmed.
- Rejected: a prefix such as sha256: in front of the digits.
- Rejected: a digest written in Base64, as used in Subresource Integrity attributes. Convert it with Base64 to Hex first.
- Rejected: digests of other lengths, including MD5 with 32 digits, SHA-1 with 40 and SHA-512 with 128.
- Rejected input stops with Enter a 64-character hexadecimal SHA-256 digest.
When a hash check helps and what it proves
A checksum travels well alongside embedded data. APIs that accept a file as Base64 often take a digest field too. Release notes list SHA-256 values for downloads. When a certificate, firmware block or attachment sits inside JSON or YAML, hashing the decoded bytes confirms that copying and re-encoding did not alter it.
A match proves integrity relative to the digest you supplied, nothing more. If an attacker could replace both the data and the published hash, the check still passes. Authenticity needs a signature or an HMAC with a key the attacker does not have.
Frequently asked questions
Is the hash calculated from the Base64 text or the decoded data?
From the decoded data. The tool turns the Base64 back into bytes first and hashes those, so the digest equals the SHA-256 of the original file and does not depend on padding or alphabet.
Why does my hash differ from the sha256sum output?
Check three things: that the command hashed the original file and not its Base64 text, that no trailing newline was added by echo, and that the Base64 was not truncated when copied.
Can I check an MD5 or SHA-1 checksum here?
No. Only SHA-256 is computed, and the expected box accepts only 64 hex digits. Shorter or longer digests are rejected before any comparison is made.
What does Mismatch mean?
The SHA-256 of the decoded bytes is not the digest you entered. Either the data changed, the digest belongs to a different file or version, or the expected value is for another algorithm that also has 64 hex digits.
Is my data sent anywhere to compute the hash?
No. Decoding and hashing both run in your browser through the Web Crypto API. Neither the Base64 value nor the digest leaves the page.