Skip to content
Return to Calculators Hub

Binary Calculator

Math

Perform binary arithmetic (+, -, *, /) and bitwise operations (AND, OR, XOR, NOT, shifts) plus real-time conversions to Decimal, Hex, and Octal.

Binary (Base 2) Result
11000₂
Decimal (Base 10) 24
Hexadecimal (Base 16) 18₁₆
Octal (Base 8) 30₈
8-Bit 2's Complement: 00011000
16-Bit: 0000000000011000

How This Calculator Works

Binary is a base-2 numeral system that represents numeric values using two distinct symbols: 0 and 1. Because computer hardware operates via transistor switches that are either off (0) or on (1), binary is the fundamental internal language of all modern digital electronics, CPUs, memory storage, and network protocols.

📐 Binary to Decimal Positional Conversion
Decimal = Σ (bᵢ × 2ⁱ) | for bits bᵢ at position i (from right to left, i=0)
bᵢ: Binary bit digit at index i (either 0 or 1)
2ⁱ: Place value power of two (1, 2, 4, 8, 16, 32, 64, 128, ...)
Byte: Standard unit of digital information consisting of 8 bits
Nibble: A 4-bit half-byte grouping corresponding to 1 hexadecimal digit

Key Mathematical Rules & Properties

Binary Addition Rules

0 + 0 = 0; 0 + 1 = 1; 1 + 0 = 1; 1 + 1 = 10 (0 with a carry of 1 to the next place value); 1 + 1 + 1 = 11 (1 with a carry of 1).

Bitwise Logic (AND, OR, XOR, NOT)

AND requires both bits to be 1; OR requires at least one bit to be 1; XOR produces 1 if and only if the bits differ; NOT flips 1s to 0s and 0s to 1s.

Bit Shift Multiplication & Division

Left shift (<< 1) doubles the integer value; Right shift (>> 1) performs integer division by 2.

Two's Complement Representation

Negative binary integers in computer memory are represented by inverting all bits and adding 1: -X = (~X) + 1.

✎

Worked Example: Adding Binary Numbers

Calculate binary addition: 1011₂ + 0110₂ and verify in decimal.

  1. Convert 1011₂ to decimal: (1×8) + (0×4) + (1×2) + (1×1) = 8 + 0 + 2 + 1 = 11.
  2. Convert 0110₂ to decimal: (0×8) + (1×4) + (1×2) + (0×1) = 0 + 4 + 2 + 0 = 6.
  3. Add in decimal: 11 + 6 = 17.
  4. Perform binary column addition from right to left with carries: 1011₂ + 0110₂ = 10001₂.
  5. Verify 10001₂: (1×16) + (0×8) + (0×4) + (0×2) + (1×1) = 17.
Final Answer: 10001₂ (Decimal: 17, Hex: 11)

Frequently Asked Questions

Why do computers use binary instead of decimal?

Physical computer processors and memory chips are constructed from millions of silicon transistors that reliably distinguish between two electrical voltage states: High (1) and Low (0). Two-state hardware is vastly more noise-resistant and reliable than ten-state decimal hardware.

How does Two's Complement handle negative numbers?

In Two's Complement, the most significant bit (MSB) acts as the sign bit (1 for negative). To negate a number, invert all bits and add 1. This enables CPUs to perform subtraction using standard addition circuitry.

How do you convert binary to hexadecimal quickly?

Group the binary bits into clusters of 4 starting from the right (nibbles), and replace each 4-bit cluster with its corresponding hex digit (0000=0, 1010=A, 1111=F).

What is a bitwise XOR used for in software?

XOR (exclusive OR) is extensively used in cryptography, error-checking checksums (CRC), hashing functions, graphics rendering masks, and toggling binary flags.

Understanding your calculation

Method, example and limitations

How the calculation works

Binary is base two, so each place has a value that is a power of two. Arithmetic carries when a column reaches two.

Example to check

Binary 1011 equals 8 + 2 + 1 = decimal 11. Binary 101 + 11 equals 1000.

Before using the result

Leading zeros do not change an unsigned value. Signed integers, bit width and two’s-complement interpretation require explicit conventions.

Calculation methodology · Report a result that needs review