Math

Binary Calculator

Convert between binary, decimal, octal, and hex, or add, subtract, multiply, and divide binary numbers.

Formulas

Binary → Decimal

Each digit is multiplied by a power of 2 based on position

Decimal → Binary

Divide by 2 until 0, reverse the remainders

Binary → Octal

Each octal digit maps to exactly 3 binary digits

Binary → Hex

Each hex digit maps to exactly 4 binary digits

Binary Addition

Same as decimal addition, but carries at 2 instead of 10

Binary Subtraction

Borrowing works like decimal, but a borrow is worth 2

Why Base 2?

Binary (base 2)

Uses only digits 0 and 1. Matches the on/off electrical states of transistors, making it the native language of all digital hardware.

Octal & Hex

Shorthand for binary. Octal (base 8) groups 3 bits per digit; hex (base 16) groups 4 bits per digit — both make long binary strings easier to read.

Example: decimal 42 = binary 101010 = octal 52 = hex 2A.

Tips

Base converter: pick the base your number is currently written in, then read off all four conversions at once.

Binary arithmetic: only 0s and 1s are accepted for A and B — the calculator converts to decimal, computes, and converts back.

Negative results: if subtraction goes negative, binary can't represent it directly without two's complement, so the decimal result is shown instead.

FAQ

Frequently asked questions.

How do I calculate binary?

To convert a decimal number to binary, repeatedly divide the number by 2 and record the remainder at each step. Reading the remainders from bottom to top gives the binary equivalent. For example, 10 ÷ 2 = 5 remainder 0, 5 ÷ 2 = 2 remainder 1, 2 ÷ 2 = 1 remainder 0, 1 ÷ 2 = 0 remainder 1 — reading the remainders bottom-to-top gives 1010. This calculator automates the process for any base instantly as you type.

What is the binary number for 10000?

The binary number 10000 represents the decimal value 16. Each digit in a binary number stands for a power of 2, counting from the right starting at 2⁰. The digit '1' in the fifth position from the right equals 2⁴ = 16, and every other digit is 0, so 10000 in binary equals 16 in decimal.

How do you convert decimal to binary manually?

Convert decimal to binary by finding the largest power of 2 that fits into the number, subtracting it, and repeating with the remainder until you reach zero — marking a 1 for each power of 2 used and a 0 for each skipped. For example, to convert 42: 32 (2⁵) fits, leaving 10; 8 (2³) fits, leaving 2; 2 (2¹) fits, leaving 0. That gives 101010, matching bits at positions 5, 3, and 1.

How does binary addition and subtraction work?

Binary addition follows the same place-value rules as decimal addition, but any sum of 2 or more carries over to the next column (since binary only has digits 0 and 1). For example, 1 + 1 = 10 (0 with a carry of 1). Binary subtraction borrows from the next column when the top digit is smaller than the bottom digit, just like decimal subtraction, but a borrow is worth 2 instead of 10. This calculator performs both operations by converting to decimal, computing the result, and converting back to binary.

Why do computers use binary instead of decimal?

Computers use binary (base-2) because their electronic circuits are built from transistors that are most reliably operated in two states: on (1) and off (0), represented by high and low voltage. Using only two states makes hardware simpler, cheaper, and far less prone to error than trying to distinguish ten different voltage levels for decimal digits. Every operation inside a CPU — arithmetic, logic, memory storage — ultimately reduces to binary signals.

What are hexadecimal and octal, and how do they relate to binary?

Hexadecimal (base-16, digits 0-9 and A-F) and octal (base-8, digits 0-7) are shorthand notations for binary because both 16 and 8 are powers of 2. Each hex digit maps exactly to 4 binary digits, and each octal digit maps exactly to 3 binary digits, so programmers use them to write long binary strings more compactly. For example, binary 101010 groups into hex as 2A and into octal as 52 — both represent the same decimal value, 42.

Last updated: August 17, 2026