Skip to main content
Byte Array Tools

Byte Array Compare

Compare two byte arrays or hex strings and list every offset where they differ, with a summary of the first difference and any length mismatch.

Paste two byte sequences - hashes, packets, file headers - to see exactly where and how they differ.

For comparing text line by line, a text diff is easier to read - this tool is for exact byte-level differences.

What Is Byte Array Compare?

It compares two byte sequences position by position and lists every offset where they differ, with both values in hex and as characters. A summary gives the number of differences, the first differing offset and any difference in length.

When to Use It

  • Two hashes, signatures or keys should match but do not.
  • A file or a network message is slightly different from the expected one.
  • Checking which bytes an encoder, compressor or driver changed.

How to Use It

  1. Paste the first sequence in A and the second in B - hex, decimal, Base64 or code arrays.
  2. Leave the format on automatic detection, or set it for both inputs.
  3. Read the summary and the table of differing offsets.

Example

A = 89 50 4E 47 0D 0A 1A 0A 00 00 00 0D (a correct PNG start) and B = the same bytes with 0D missing. The result: 6 byte(s) differ, A is 12 bytes and B is 11, first difference at offset 4. This is the classic sign of a PNG damaged by a text-mode transfer that turned \r\n into \n.

Understanding the Output

The comparison is by position. When a byte is inserted or removed, everything after it shifts, so all following positions differ - look at the first difference to find the cause.

Limitations

The tool does not re-align sequences after an insertion the way a text diff does, and the table lists the first 1,000 differences. To view a whole file, use the Hex Viewer; to compare hashes of large files, hash them first with the SHA-256 Generator.

Frequently Asked Questions

The comparison is by position. If a byte is inserted or removed, every later byte moves by one position, so all following offsets differ. The first difference in the summary is where the change happened.

For small files, convert each with File to Byte Array and paste the results here. For large files, compare their SHA-256 hashes first - if the hashes match, the files are identical.

With automatic detection, each input is detected separately, so you can compare hex with decimal. If you choose a specific format, it applies to both inputs.
Share this tool: