Loading Hash Compare...
Please wait a moment

How to Use Hash Compare - Step by Step Guide

Compare two payloads using cryptographic digests to confirm exact byte-for-byte equality

Step 1

Add Input A and Input B

Paste two values or upload files on each side. The tool hashes both values with the same Web Crypto digest algorithm.

Paste directly: Paste JSON, XML, plain text, config files, or any UTF-8 content into each editor panel
Upload files: Load .txt, .json, .xml, or .csv file content into Input A or Input B separately
Try the sample: Click "Sample" to load identical JSON payloads and see a matching hash result

Example: Comparing Two API Responses

Both inputs produce the same SHA-256 digest when content is identical:

Input A: {"orderId":"A-100","amount":99.50,"currency":"USD"}
Input B: {"orderId":"A-100","amount":99.50,"currency":"USD"}

Result → Hash Match (both inputs produce identical SHA-256 digest)
Step 2

Choose Hash Algorithm

Select from SHA-2 family algorithms to match your system requirements. SHA-256 is the default and recommended for most use cases.

SHA-256: 256-bit digest, industry standard for integrity checks and Git commit verification
SHA-512: 512-bit digest for high-security environments and large payload verification
SHA-1: Legacy 160-bit digest for backward compatibility with older systems
Step 3

Read Match Status

The SubtleCrypto API computes both digests and shows a clear match or mismatch indicator.

Hash Match: Identical digests confirm inputs are byte-for-byte equal — no data corruption or modification
Hash Mismatch: Even a single character, whitespace, or newline difference produces completely different digests
Side-by-side view: Both hex digests are displayed for manual comparison and auditing

Example: Detecting a Single Character Change

A single letter case change produces a completely different digest:

Input A: {"status":"active"}
Input B: {"status":"Active"}

Hash A: 9a3e...f7b2
Hash B: 4c1d...a8e5
Result → Hash Mismatch (capital "A" changes the entire digest)
Step 4

Export Comparison Result

Copy or download the comparison summary for audit logs, CI pipelines, or security testing workflows.

Copy to clipboard: Copy the full comparison output including both digests and match status
Download as file: Save comparison result as a plain text file for incident records
Next step: Use Checksum Verify to validate against a known expected hash value

Frequently Asked Questions

Do matching hashes guarantee the same input?

Yes. With collision-resistant algorithms like SHA-256 and above, matching digests confirm identical inputs for all practical integrity checks.

Can I compare JSON with formatting differences?

Not directly. Different whitespace, key order, or newlines produce different hashes. Normalize both inputs first with JSON Formatter before comparing.

Is the comparison done in the browser?

Yes. Both digests are computed client-side using the W3C Web Crypto API. No data leaves your browser.

Which algorithm should I use for comparison?

SHA-256 is recommended for most use cases. Use SHA-512 for high-security environments. Avoid SHA-1 for new projects as it has known collision vulnerabilities.

Can I compare output with command line tools?

Yes. For the same UTF-8 input the hex digest should match tools like OpenSSL dgst, Node.js crypto, and Python hashlib.