Decimal to Binary Converter
Instant conversion with step-by-step division math. Understand the language of computers and master 8-bit, 16-bit, and 32-bit binary logic.
Read steps from Bottom-to-Top to get this result.
Calculation Steps
Div by 28-Bit Reference Chart
Standard 0-255 lookup table.
The Language of 0s and 1s
We humans live in a base-10 world. We have ten fingers, so we count in tens (0, 1, 2... 9). But computers? They have only two "fingers": Off (0) and On (1).
Everything you see on your screen right now—this text, the colors, the images, the layout—is stored deep inside your computer's memory as a massive sequence of billions of zeroes and ones. This system is called Binary.
Understanding how to convert between our human decimals and machine binary is not just a math trick; it's the key to understanding how digital logic works. Whether you are learning about IP addresses, fixing CSS color codes, or optimizing database storage, binary is the foundation.
Manual Conversion Masterclass
Don't rely just on the calculator. Here is how you do it with a pen and paper using the "Divide by 2" method:
- Write down your decimal number.
- Divide it by 2.
- Write down the result (integer part).
- Write down the Remainder (0 or 1) on the side.
- Repeat until you reach 0.
- CRITICAL STEP: Read the remainders from the bottom up.
13 ÷ 2 = 6 (Rem 1) ← LSB (Right)
6 ÷ 2 = 3 (Rem 0)
3 ÷ 2 = 1 (Rem 1)
1 ÷ 2 = 0 (Rem 1) ← MSB (Left)
Result: 1101
The "Powers of 2" Cheat Sheet
Pros don't usually divide. They memorize the positions. Each "slot" in a binary number doubles in value.
Why 8-Bit, 16-Bit, and 32-Bit?
You might notice our tool supports different "Bit Depths". This refers to how many digits of binary the computer uses to store a single number.
- 8-BitMax: 255
The "Byte". Used for ASCII text, classic Nintendo graphics, and RGB color channels (Red, Green, Blue).
- 16-BitMax: 65,535
Used for "High Color" images, old-school game audio, and network port numbers.
- 32-BitMax: ~4.29 Billion
The standard integer size for modern apps. Used for IP addresses and handling larger data sets.
Warning: Overflow Errors
What happens if you try to store the number 256 in an 8-bit system?
It crashes. 256 in binary is 100000000. That requires 9 bits. If you only have 8 slots, the leading "1" gets cut off, and the computer sees 00000000. Your bank account balance goes from $256 to $0 instantly. This is called an Integer Overflow, and it is a classic bug that programmers must guard against.
Frequently Asked Questions
How do I manually convert a decimal number to binary?
The most reliable method is "Division by 2". Take your decimal number and divide it by 2. Write down the remainder (which will always be 0 or 1). Take the result (quotient) and divide by 2 again. Repeat this until you reach 0. The binary number is the sequence of remainders read from the last one you calculated (bottom) to the first (top).
What is the binary representation of 255?
The binary representation of 255 is 11111111. It is the maximum value that can be stored in an 8-bit byte, making it a significant number in computer science (often seen in IP addresses and color codes).
Why do computers use binary instead of decimal?
Computers run on electricity. It is much easier and more reliable to measure two distinct states (High Voltage = 1, Low Voltage = 0) than to measure ten subtle voltage levels to represent 0-9. This binary "On/Off" logic is the physical foundation of all modern processor architecture.
How do I convert binary back to decimal?
To convert back, you use "Powers of 2". Read the binary digits from right to left. The first bit is worth 1, the second is 2, the third is 4, then 8, 16, 32, and so on. Simply add up the values of all the positions where the bit is "1". For example, 101 = 4 + 0 + 1 = 5.
What is the difference between a Bit and a Byte?
A "Bit" (Binary Digit) is the smallest unit of data, a single 0 or 1. A "Byte" is a group of 8 bits. While a bit can only represent 2 values, a byte can represent 256 distinct values (2^8), which is enough to store a single ASCII character like "A" or "!"
How are negative numbers represented in binary?
Computers use a system called "Two's Complement". The left-most bit is reserved as the "Sort Bit". If it is 1, the number is negative. To convert a negative number, you take the positive binary version, flip all the bits (0 becomes 1, 1 becomes 0), and then add 1 to the result.
Can binary represent fractions or decimals?
Yes. Just as we have a decimal point, binary has a "radix point". Bits to the right of this point represent fractions: 1/2, 1/4, 1/8, etc. In modern computing, the IEEE 754 standard ("Floating Point") is used to store these complex fractional values efficiently.
What are "Significant Bits"?
The "Least Significant Bit" (LSB) is the right-most bit, representing the smallest value (1). The "Most Significant Bit" (MSB) is the left-most bit, representing the largest power of 2 in that number (e.g., 128 in an 8-bit number). Changing the MSB has the biggest impact on the value.
Why is Hexadecimal often used with Binary?
Binary strings are very long and hard for humans to read (e.g., 101101011101). Hexadecimal (Base-16) perfectly compresses every 4 bits of binary into 1 hex digit. This makes code shorter and easier to debug. For conversion, you just group binary digits into sets of 4.
What is a "Bitwise Shift"?
A bitwise shift moves all bits to the left or right. Shifting left (<<) effectively multiplies the number by 2. Shifting right (>>) effectively divides the number by 2 (dropping the remainder). This operation is incredibly fast for processors to perform compared to standard multiplication.
What happens if a calculation exceeds the bit limit (Overflow)?
If you add 1 to the maximum value (e.g., 11111111 + 1 in 8-bit), the mathematical result is 256 (100000000), but an 8-bit system only has room for the lower 8 zeroes. The result wraps around to 0. This "Integer Overflow" can cause serious bugs in software, often crashing games or financial systems.
How many distinct values can 32 bits hold?
A 32-bit integer system can store 2^32 distinct values, which is 4,294,967,296. If unsigned, the range is 0 to ~4.29 billion. If signed, it is split roughly from -2.14 billion to +2.14 billion.
Is binary the only alternative number system?
No. Octal (Base-8) was popular in the early days of computing. Some experimental computers have even tried Ternary (Base-3) logic. However, binary remains the undisputed standard because of its seamless mapping to the On/Off physical switches (transistors) of hardware.
What is ASCII code?
ASCII is a standard that maps binary numbers to human characters. For example, the binary number 01000001 (Decimal 65) is assigned to the uppercase letter "A". This allows computers to store text documents as long strings of binary numbers.
How do IP addresses use binary?
An IPv4 address (like 192.168.1.1) is actually four 8-bit binary numbers separated by dots. Computers see it as one continuous 32-bit string (11000000101010000000000100000001). Subnet masks use binary logic to filter network traffic.