Bitwise XOR Calculator

Quick answer

The bitwise XOR calculator applies XOR to two numbers bit by bit – entered in binary, octal or decimal – with a fixed bit width, and shows the result in binary, decimal (signed and unsigned), octal and hexadecimal. You can switch to the other bitwise operations too.

Result (binary)
0000 1101
Result (decimal, unsigned)
13
Result (decimal, signed two's complement)
13
Result (octal)
15
Result (hexadecimal)
D
Bit by bit
0000 1011 XOR 0000 0110 ───────── = 0000 1101

Bitwise operations work on each pair of bits independently. XOR is used for toggling bits, simple encryption (one-time pad), checksums and parity, and swapping two variables without a temporary. Programmers meet it in C, Java, Python and JavaScript as the ^ operator.

How to use the Bitwise XOR Calculator

  1. Representation
  2. Number format
  3. Number 1
  4. Number 2
  5. Operation

Everything is calculated in your browser, so results appear instantly and nothing you type is sent to a server.

How it works

Choose the bit width (representation) and the input format, then enter both numbers. They are padded to the chosen width, combined bit by bit and the result is shown in every common base. With a fixed width, the signed value uses two’s complement.

Formula

a XOR b is 1 when the bits differ; truth table: 0 0 → 0, 0 1 → 1, 1 0 → 1, 1 1 → 0

Worked example

Inputs — Representation: 8-bit; Number format: Binary; Number 1: 1011; Number 2: 0110; Operation: XOR.
Results — Result (binary) = 0000 1101; Result (decimal, unsigned) = 13; Result (decimal, signed two's complement) = 13; Result (octal) = 15; Result (hexadecimal) = D; Bit by bit = 0000 1011
XOR 0000 0110
─────────
= 0000 1101.

Key terms

Bit
A binary digit, 0 or 1.
Bit mask
A pattern of bits used to select or change other bits.

Frequently asked questions

What does bitwise XOR do?

It compares two numbers bit by bit: a XOR b is 1 when the bits differ.

Why choose a bit width?

Operations like NOT, NOR and the signed value depend on how many bits the number has.

Can I enter decimal numbers?

Yes – choose Decimal as the number format.

What is the difference between bitwise and logical XOR?

Logical operators treat whole values as true/false; bitwise ones act on every bit separately.

Sources

  1. Wolfram MathWorld – Binary
  2. Harvard CS50 – Binary and bitwise operators

Cite this calculator

Speedy Calculator. (2026). Bitwise XOR Calculator. Speedy Calculator. https://speedycalculator.com/calculators/math/bitwise-xor/