Binary ↔ Decimal Converter
Convert between binary (base 2) and decimal (base 10) instantly
Binary is the language of computers, using only 0 and 1. Decimal is what humans use daily. This converter helps you switch between both systems instantly. Perfect for programmers, computer science students, and anyone learning how computers work at a fundamental level.
Loading calculator...
How It Works
The Binary-Decimal Formula
Understanding how conversion works mathematically
Formula
Decimal = Σ(Bit × 2^position) | Binary = Repeated division by 2 reading remainders
Variables
Powers of 2
Each binary digit (bit) represents a power of 2. The rightmost bit is 2⁰ (value 1), next is 2¹ (2), then 2² (4), 2³ (8), and so on.
Bit Position
Count from 0 starting at the rightmost digit. For example, the binary number 1010 has positions 3,2,1,0 from left to right.
Weighted Value
Multiply each bit (0 or 1) by its power of 2, then sum all results to get the decimal value.
Note: To convert decimal to binary, repeatedly divide the decimal number by 2, recording remainders (0 or 1) from bottom to top. This is the fundamental algorithm used by all computers to represent numbers in binary.
Step-by-Step Example
Converting binary 1010 to decimal
Identify each binary digit and its position
Binary: 1 0 1 0 (reading from left to right)
Assign powers of 2 from right (position 0)
Rightmost: position 0 = 2⁰ = 1 | Next: position 1 = 2¹ = 2 | Next: position 2 = 2² = 4 | Leftmost: position 3 = 2³ = 8
Multiply each bit by its power of 2
Leftmost 1 × 8 = 8 | Next 0 × 4 = 0 | Next 1 × 2 = 2 | Rightmost 0 × 1 = 0
Sum all results
8 + 0 + 2 + 0 = 10
Result
Binary 1010 = Decimal 10
Reference Guide
| unit | value | note |
|---|---|---|
| Binary 0 | Decimal 0 | 0000 |
| Binary 1 | Decimal 1 | 0001 |
| Binary 10 | Decimal 2 | 0010 |
| Binary 11 | Decimal 3 | 0011 |
| Binary 100 | Decimal 4 | 0100 |
| Binary 101 | Decimal 5 | 0101 |
| Binary 110 | Decimal 6 | 0110 |
| Binary 111 | Decimal 7 | 0111 |
| Binary 1000 | Decimal 8 | 1000 |
| Binary 1001 | Decimal 9 | 1001 |
| Binary 1010 | Decimal 10 | 1010 |
Understanding Binary Numbers
What binary means in the real world
A byte is 8 bits, representing numbers from 0 to 255. This is the standard unit of data in computing — every character in text, every pixel colour component, and every basic instruction in your computer is stored as a byte.
Best for: Example: 255 in binary is 11111111. Any number above 255 requires more than 8 bits (2 bytes, 4 bytes, etc.).
16 bits can represent 65,536 unique values (2^16). This was the standard for early home computers (like the Commodore 64 and original Nintendo) and is still used for many data types in modern systems.
Best for: Example: 65,535 in binary is 1111111111111111. Used for Unicode's Basic Multilingual Plane and old-school game memory addresses.
32-bit integers are the standard size for many computer systems and programming languages. They can represent over 4 billion unique values — sufficient for most counting applications.
Best for: Example: 4,294,967,295 in binary is thirty-two 1s. The maximum value for a 32-bit unsigned integer.
64-bit integers are the current standard in modern processors. They can represent numbers up to approximately 18.4 quintillion — enough to count every atom in a grain of sand.
Best for: Example: 18,446,744,073,709,551,615 in binary is sixty-four 1s. This calculator supports numbers up to this limit (but your input will be capped for practical display).
Why Computers Use Binary — The Foundation of Digital Computing
Computers use binary (base-2) because at their most fundamental level, they are made of billions of tiny switches called transistors. Each transistor can only be in one of two states: ON (representing 1) or OFF (representing 0). Binary is the direct, faithful representation of these physical states. The alternative — decimal (base-10) — would require components that can reliably represent ten distinct states (0–9). While theoretically possible, ten-state components are less reliable, slower, and far more expensive to manufacture than two-state transistors. Every piece of data in your computer — every letter in this text, every pixel on your screen, every sound in the music you hear — is ultimately stored as binary. A text character is represented by 8 bits (one byte). A typical photo contains millions of pixels, each with colour values stored in 24 bits (8 bits for red, 8 for green, 8 for blue). The instructions that run your operating system and applications are also binary. Understanding binary conversion is essential for programmers, computer science students, and anyone who wants to understand what computers actually do at the lowest level. It is not merely an academic exercise — it is the fundamental language that makes all computing possible.
Key Features
💡 Pro Tips
- →Binary numbers use only 0 and 1 — if you see other characters, check your input for letters or digits 2–9
- →Use the Swap button to quickly reverse the conversion direction without re-entering numbers
- →Binary numbers can get long quickly — 255 in decimal is 11111111 in binary (8 digits)
- →The rightmost bit is the 'least significant bit' (LSB) — 2⁰ position
- →Use the Quick Examples to learn common binary patterns: 8 = 1000, 16 = 10000
- →Every additional bit doubles the range of representable numbers — 8 bits = 256 values, 16 bits = 65,536 values
- →Programmers often memorise powers of 2 up to 2^10 (1,024) — it's a useful mental tool
Common Mistakes
Entering letters in binary input
Binary only allows digits 0 and 1. Any letter or digit 2–9 will trigger a validation error. If you see this error, check if you accidentally typed a letter instead of a digit.
Forgetting that binary reads from right to left for positional values
The rightmost digit is the least significant bit (2⁰ position). Many beginners assume the leftmost digit is multiplied by the smallest power — this is incorrect. Always start counting positions from 0 on the RIGHT.
Confusing 'bit' with 'byte'
A bit is a single binary digit (0 or 1). A byte is 8 bits. 1000 in binary is 8 (not a byte). 11111111 in binary is 255 — one full byte. Don't confuse the two terms.
Not accounting for leading zeros
Binary numbers can have leading zeros without changing their value (001010 is the same as 1010). Our calculator automatically handles leading zeros correctly.
Research & Citations
All factual claims on this page are sourced from peer-reviewed research
- [1]
Shannon, C.E. (1948). A Mathematical Theory of Communication. Bell System Technical Journal, 27(3), pp. 379–423.
Foundational paper establishing binary digits ('bits') as the fundamental unit of information
View source - [2]
Leibniz, G.W. (1703). Explication de l'Arithmétique Binaire. Mémoires de l'Académie Royale des Sciences.
First publication of the binary number system in the West by Gottfried Wilhelm Leibniz
This calculator is a reference tool and does not constitute medical advice. For personalised sleep health guidance, consult a qualified healthcare provider.
Last updated: January 10, 2025
Creators
Developer
Table of Contents
Quick Facts
Related Tools
Privacy Guaranteed
Your data never leaves your browser. All calculations are 100% private.
Frequently Asked Questions
How do I convert binary to decimal?
Multiply each binary digit by 2 raised to its position (starting from 0 on the right), then sum all results. For example, binary 1010 = (1×8) + (0×4) + (1×2) + (0×1) = 8 + 0 + 2 + 0 = 10 decimal. Use our calculator for instant results with any binary number.
How do I convert decimal to binary?
Divide the decimal number by 2 repeatedly, recording remainders (0 or 1) from bottom to top. For example, 13 ÷2 = 6 remainder 1, ÷2 = 3 remainder 0, ÷2 = 1 remainder 1, ÷2 = 0 remainder 1 → reading from bottom: 1101 binary. Our calculator does this automatically.
What is 255 in binary?
255 in binary is 11111111 (eight 1s). This is the maximum value of a single byte (8 bits) and is frequently used as a colour value in RGB (white) and as a subnet mask in networking (255.255.255.0).
What is binary used for in real life?
Binary is the fundamental language of all computing — every file on your computer, every instruction your processor runs, every pixel on your screen, and every character in this text is ultimately stored as binary. Programmers working with low-level code, embedded systems, networking (IP addresses), and digital circuit design need binary every day.
Why do computers use binary instead of decimal?
Computers use binary because transistors have only two reliable states: ON (1) and OFF (0). Decimal would require components capable of reliably distinguishing ten different voltage levels, which is far less reliable, slower, and more expensive. Binary is the most reliable and efficient way to represent data digitally.
What is the largest binary number this calculator can convert?
This calculator supports up to 64-bit numbers (approximately 20 decimal digits or 64 binary digits). This is sufficient for virtually all practical applications, including 64-bit integer programming, IP address calculations (32-bit), and colour values (24-bit).