Binary Calculator

Add, subtract, multiply, divide and apply bitwise AND / OR / XOR on binary numbers — with instant base conversion.

Your binary operation

Results update live as you type.

digits 0 / 1
arithmetic or bitwise
digits 0 / 1
A = ? · B = ?
10
OperationA + B
Live calculation

Binary result

10111

1101 + 1010 = 10111₂ (= 23 in decimal)

Binary (2)

10111

base 2

Decimal (10)

23

base 10

Hex (16)

17

base 16

Octal (8)

27

base 8

Bit visualisation 1 = on (blue), 0 = off
DecimalBinaryHexOctal

The Method

How binary arithmetic works

Each binary digit (bit) is a power of two. The number 1101₂ equals 1·8 + 1·4 + 0·2 + 1·1 = 13 in decimal. Addition and subtraction follow the same column-and-carry rules as base 10, just with carry happening at 2 instead of 10. Multiplication reduces to shifting and adding. Bitwise operations (AND, OR, XOR) act independently on each bit position — they are the fundamental operations of digital logic.

Working for current operation

1101₂ + 1010₂ = 10111₂ (= 23₁₀)
A binary input (1101)
B binary input (1010)
op operation (+)
R decimal result (23)

About This Tool

What Is a Binary Calculator?

A binary calculator performs arithmetic and bitwise operations on numbers written in base 2 — the language of computers. Enter two binary numbers, choose an operation (+, , ×, ÷, AND, OR, XOR), and the calculator returns the binary result along with the decimal, hexadecimal, and octal equivalents.

Binary is the foundation of all digital electronics. Each binary digit (a bit) is either 0 or 1, mapped to two voltage levels in hardware. Eight bits make a byte, which can represent 256 distinct values. Hexadecimal (base 16) is just a compact way of writing binary — each hex digit corresponds to exactly 4 bits. Programmers and electronics engineers move between these bases constantly.

The calculator also doubles as a base converter: enter a value in any one of binary, decimal, hex, or octal, and see all four representations side by side. Internally the JavaScript engine parses the value, computes the result as an integer, and re-renders it in each base. Bitwise operations use JavaScript's 32-bit integer operators, so they are accurate for numbers up to 2³¹ − 1.

Use this free binary calculator for digital-electronics homework, low-level programming, computer-architecture revision, or quick conversion of colour codes and memory addresses. Every calculation runs locally — no sign-up, no tracking.

Arithmetic

Addition, subtraction, multiplication, and integer division in binary.

Bitwise AND / OR / XOR

The three fundamental digital-logic operations applied bit by bit.

Base Converter

Convert between binary, decimal, hex, and octal in one step.

Bit Visualisation

See each bit as on / off — instantly intuitive for digital-logic study.

100% Free & Private

No account, no tracking — every calculation runs locally in your browser.

Powers of 2 Reference

Quick lookup table for 2⁰ through 2¹⁶ in all four bases.

How to Use This
Binary Calculator

From arithmetic to bitwise to base conversion — six clear steps.

1

Pick a Mode

Switch between Binary arithmetic and Base converter using the tabs above the inputs.

2

Enter Binary Inputs

Type binary numbers using only digits 0 and 1. The decimal preview shows what each input is in base 10.

3

Pick an Operation

Choose arithmetic (+ − × ÷) or bitwise (AND, OR, XOR). Operations update the result instantly.

4

Read All Four Bases

The stat tiles show the result in binary, decimal, hex, and octal — all four representations at once.

5

Inspect the Bit Cells

The bit-cell strip highlights which bits of the result are on (1) versus off (0) — an at-a-glance summary of the binary value.

6

Reference Powers of 2

The reference table lists 2⁰ through 2¹⁶ in decimal, binary, hex, and octal — a handy lookup when working through problems by hand.

Frequently Asked Questions

Everything you need to know about binary arithmetic, bitwise operations, and base conversion.

Binary is the base-2 number system using only the digits 0 and 1. Each binary digit (a bit) represents a power of two; the rightmost bit is 2⁰ = 1, the next is 2¹ = 2, then 2² = 4, and so on. Computers use binary because digital electronics naturally represent two states (on / off, high / low voltage, charged / uncharged).

Repeatedly divide by 2, recording each remainder. The binary representation is the remainders read from bottom to top. For example, 13: 13 ÷ 2 = 6 r 1; 6 ÷ 2 = 3 r 0; 3 ÷ 2 = 1 r 1; 1 ÷ 2 = 0 r 1. Reading bottom-up: 1101. Verify: 1·8 + 1·4 + 0·2 + 1·1 = 13. ✓

Multiply each bit by its corresponding power of 2 and add the results. For 1101: 1·2³ + 1·2² + 0·2¹ + 1·2⁰ = 8 + 4 + 0 + 1 = 13. Read bits from right to left, starting the exponent at 0 and increasing by 1 with each step.

Bitwise AND compares two binary numbers bit by bit. The result bit is 1 only if both corresponding bits are 1; otherwise it is 0. Example: 1101 AND 1010 = 1000. AND is commonly used to mask bits — to isolate specific bits while zeroing out the rest.

Bitwise OR returns 1 if either bit is 1, and 0 only if both bits are 0. Example: 1101 OR 1010 = 1111. OR is used to set bits — combining masks or flags into a single value.

Bitwise XOR (exclusive OR) returns 1 if the two corresponding bits are different and 0 if they are the same. Example: 1101 XOR 1010 = 0111. XOR has elegant properties — A XOR A = 0, A XOR 0 = A — and is used in cryptography, checksums, and to toggle individual bits.

Hexadecimal (base 16) uses 16 digits: 0-9 and A-F (where A = 10, B = 11, … F = 15). Each hex digit corresponds to exactly 4 binary bits, so hex is a compact, human-friendly way to write binary numbers. It is everywhere in low-level computing: colour codes like #FF0000 (red), memory addresses, MAC addresses, file checksums.

Octal (base 8) uses the digits 0-7. Each octal digit corresponds to exactly 3 binary bits. Historically octal was popular on machines with 12, 24, or 36-bit words. Today it is still used in Unix-style file permissions (e.g. chmod 755) and the 0o prefix in many programming languages.

Same column-and-carry method as decimal, but carry happens at 2 instead of 10. The rules per column: 0 + 0 = 0; 0 + 1 = 1; 1 + 1 = 0 (carry 1); 1 + 1 + 1 (with incoming carry) = 1 (carry 1). Example: 1101 + 1010: rightmost column 1 + 0 = 1; next 0 + 1 = 1; next 1 + 0 = 1; next 1 + 1 = 0 carry 1. Result: 10111 (= 23 in decimal).

Because digital electronics are most reliable with just two states. A transistor is either on or off, a voltage is either above or below a threshold, a magnetic region is north or south. Binary maps perfectly to that — a 10-state circuit would need more sensitive components and would be much more error-prone. Binary is also mathematically clean: every value has a unique representation.

Two's complement is the standard way to represent signed integers in binary. The leftmost bit is the sign bit (0 = positive, 1 = negative), and negation is performed by inverting all bits and adding 1. For an 8-bit two's complement, values range from −128 to +127. This calculator works with unsigned binary in the arithmetic mode; the bitwise mode uses JavaScript's 32-bit signed semantics for AND / OR / XOR.

The arithmetic and conversion modes are accurate for integers up to 2⁵³ − 1 (about 9 × 10¹⁵). Bitwise operations (AND, OR, XOR) use JavaScript's 32-bit signed integer operators and so are accurate for values up to 2³¹ − 1. For very large exact binary arithmetic, use the Big Number Calculator.