Skip to content

Binary Calculator

Perform binary arithmetic and bitwise operations with visual bit display

Working with Binary? Skip the Paper.

If you’ve ever tried to AND two 8-bit numbers by hand, you know how tedious it gets. One misplaced bit and the whole thing’s wrong. This calculator handles AND, OR, XOR, NOT, addition, and subtraction on binary numbers, showing results in both binary and decimal with a visual bit layout so you can actually see what happened.

How It Works

Type in binary number A (just 0s and 1s, something like 11010110), pick your operation, enter binary number B if needed, and hit Calculate. The result shows up in binary and decimal side by side, with each bit laid out visually.

Quick example: A = 11001010, B = 10110011, operation = AND. Result: 10000010 (that’s 130 in decimal). Only the positions where both inputs had a 1 survived, which is exactly how subnet masking works in networking.

What Each Operation Does

AND keeps a bit only when both inputs have a 1 at that position. Networking people use this constantly for subnet calculations. OR sets a bit when either input has a 1, it’s how you turn specific flags on without touching the others. XOR flips bits where inputs disagree, which is why it shows up in encryption and checksums. NOT just inverts everything within the input’s bit-width.

Addition and subtraction work like you’d expect, binary arithmetic with carries and borrows, same as you learned in CS class but without the pencil-and-paper errors.

Who Actually Needs This

Students working through computer architecture homework. Network engineers double-checking subnet math before deploying firewall rules. Embedded developers verifying bit manipulation logic before flashing it to a microcontroller. Competitive programmers who need a quick sanity check on a bitwise trick during a contest.

Honestly, most people reach for this when they’re debugging something. You think your bitmask is right, you run the AND here, and it either confirms your logic or saves you twenty minutes of staring at the wrong register value.

For converting between binary, octal, hex, and decimal, the Number System Converter is what you want. The Scientific Calculator handles standard math when you’re done thinking in base 2.

A Few Details

NOT flips every bit within the width of your input. So NOT of 1010 gives 0101, four bits in, four bits out. The tool figures out the bit-width from what you typed.

Input is binary only. If you’ve got decimal numbers, convert them first or use the Number System Converter. The calculator comfortably handles up to 32 or 64 bits, which covers pretty much every practical scenario.

All the math runs locally in your browser. Nothing leaves your machine.

binary calculator bitwise AND OR XOR

Related Tools

More in Math & Calculators