Binary Calculator
Convert between binary and decimal, and add two binary numbers together.
How binary numbers work
Binary is base-2 — each digit represents a power of 2, read right to left (1, 2, 4, 8, 16...). It's the fundamental number system computers use internally.
Why computers use binary
Binary (base-2) is fundamental to computing because digital circuits naturally represent two states — on/off, high/low voltage — which map directly to binary's two digits, 0 and 1. Every piece of data a computer processes, from text to images to this webpage, is ultimately represented in binary at the hardware level.
Understanding binary-to-decimal conversion is a foundational skill in computer science, useful for understanding everything from IP addressing to how computers perform arithmetic at the hardware level.
A worked example
Binary 1101 converts to decimal as (1 times 8) plus (1 times 4) plus (0 times 2) plus (1 times 1), or 13.
Adding binary 1010 (decimal 10) and 0110 (decimal 6): the sum in decimal is 16, which converts back to binary as 10000 — matching what you'd get by adding the binary numbers directly with carrying.
Why computers use binary
Binary (base 2) is the foundation of digital computing because electronic circuits can reliably represent two states — on and off, or high and low voltage — making binary a natural fit for hardware, even though it requires more digits than decimal to represent the same number.
Binary connects directly to other computing number systems: hexadecimal (base 16) is often used as a more compact, human-readable shorthand for binary, since each hex digit corresponds to exactly four binary digits.
Frequently asked questions
What characters are valid binary input?
Only 0 and 1 — any other character will be ignored or produce an invalid result.
How do I convert decimal to binary?
Repeatedly divide the decimal number by 2, recording the remainder each time, then read the remainders in reverse order — or use this calculator's binary-to-decimal conversion in reverse by testing values.
What's the largest number a given number of binary digits can represent?
An n-digit binary number can represent values from 0 to 2ⁿ−1 — for example, 8 digits (a byte) can represent 0 to 255.
How many binary digits does it take to represent a decimal number?
It depends on the number's size — generally, a number needs roughly 3.32 times as many binary digits as decimal digits to represent the same value, since binary is a less compact base.