Code tool

Calculate Binary Bitwise XOR

Enter two binary strings, choose the output width, and calculate their XOR locally in your browser.

In-browser processingNo account requiredPrivacy details ↗

Both inputs are left-padded with zeros to this width.

A QUICK WALKTHROUGH

How to use this tool

  1. Enter binary strings containing only 0 and 1.
  2. Choose an output width at least as long as the longer input.
  3. Calculate the XOR; both inputs are left-padded with zeros to that width.

Explicit width

The selected width is the exact output length. Shorter inputs are padded on the left with zeros; a width shorter than either input is rejected.

Local calculation

Input validation and XOR calculation run in this browser. No input is uploaded or stored.

GOOD TO KNOW

Common questions

What does XOR do?

It returns 1 for each position where the two aligned bits differ, and 0 where they match.

Why choose an output width?

It makes leading zeros explicit and keeps the result at a predictable length.