Loading Calculator...
Please wait a moment
Please wait a moment
Convert decimal numbers (base-10) to binary (base-2) instantly with step-by-step division breakdown. Essential for programming, computer science, digital logic, and network engineering.
This reference table shows frequently used decimal values and their binary equivalents, along with context for where these values commonly appear in computing.
| Decimal | Binary | Context |
|---|---|---|
| 0 | 0 | Null / false value |
| 1 | 1 | True / single bit |
| 2 | 10 | 2 bits minimum |
| 3 | 11 | Maximum 2-bit value |
| 4 | 100 | 3 bits minimum |
| 5 | 101 | Common small integer |
| 7 | 111 | Maximum 3-bit value |
| 8 | 1000 | 1 byte = 8 bits |
| 10 | 1010 | Base-10 round number |
| 15 | 1111 | Maximum 4-bit (nibble) |
| 16 | 10000 | 2^4, hex digit boundary |
| 32 | 100000 | 2^5, common word size |
| 64 | 1000000 | 2^6, common in computing |
| 100 | 1100100 | Decimal round number |
| 127 | 1111111 | Max signed 8-bit integer |
| 128 | 10000000 | 2^7, 8th bit set |
| 255 | 11111111 | Max unsigned 8-bit (byte) |
| 256 | 100000000 | 2^8, 9 bits needed |
| 512 | 1000000000 | 2^9 |
| 1024 | 10000000000 | 2^10, 1 KiB |
The decimal system is the standard number system used in everyday life. It uses ten digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. Each position in a decimal number represents a power of 10. For example, the number 352 is calculated as 3 x 10 squared (300) plus 5 x 10 to the first power (50) plus 2 x 10 to the zeroth power (2). The word "decimal" comes from the Latin "decimus," meaning tenth. Humans likely adopted base-10 because we have ten fingers, making it a natural counting system throughout history.
Binary is a base-2 number system that uses only two digits: 0 and 1. Each position represents a power of 2. For instance, binary 1010 equals 1 x 2 cubed (8) plus 0 x 2 squared (0) plus 1 x 2 to the first power (2) plus 0 x 2 to the zeroth power (0), which gives us 10 in decimal. Binary was formally described by Gottfried Wilhelm Leibniz in 1703, though ancient cultures including the Egyptians and Chinese used binary-like systems centuries earlier.
Digital computers use binary because electronic circuits are most reliable when switching between just two states: high voltage (1) and low voltage (0). This maps perfectly to transistor on/off states, making binary the natural language of digital electronics. Every piece of data a computer processes, including text, images, audio, and video, is ultimately encoded as sequences of binary digits (bits). A single bit holds a 0 or 1; eight bits form a byte, which can represent 256 different values (0 to 255).
The standard algorithm for converting a decimal number to binary is repeated division by 2. Divide the number by 2, record the remainder, and continue dividing the quotient until it reaches 0. Then read the remainders from bottom to top to get the binary representation.
Formula
Decimal N / 2 = Quotient ... Remainder
Repeat until Quotient = 0. Binary = remainders read bottom to top.
13 / 2 = 6 remainder 1
6 / 2 = 3 remainder 0
3 / 2 = 1 remainder 1
1 / 2 = 0 remainder 1
Reading remainders bottom to top: 13 in decimal = 1101 in binary
Verification: 1x8 + 1x4 + 0x2 + 1x1 = 8 + 4 + 0 + 1 = 13
100 / 2 = 50 remainder 0
50 / 2 = 25 remainder 0
25 / 2 = 12 remainder 1
12 / 2 = 6 remainder 0
6 / 2 = 3 remainder 0
3 / 2 = 1 remainder 1
1 / 2 = 0 remainder 1
Reading remainders bottom to top: 100 in decimal = 1100100 in binary
Verification: 64 + 32 + 0 + 0 + 4 + 0 + 0 = 100
255 / 2 = 127 remainder 1
127 / 2 = 63 remainder 1
63 / 2 = 31 remainder 1
31 / 2 = 15 remainder 1
15 / 2 = 7 remainder 1
7 / 2 = 3 remainder 1
3 / 2 = 1 remainder 1
1 / 2 = 0 remainder 1
Reading remainders bottom to top: 255 in decimal = 11111111 in binary
255 is the maximum value for an unsigned 8-bit byte: all eight bits are 1.
If you memorize the powers of 2 (1, 2, 4, 8, 16, 32, 64, 128, 256...), you can quickly decompose any decimal number. Start from the largest power of 2 that fits, subtract it, and place a 1 in that bit position. Repeat with the remainder. For example, 42 = 32 + 8 + 2 = 101010 in binary.
Powers of 2 are the building blocks of binary. Each binary digit position corresponds to a power of 2.
| Power (2^n) | Decimal | Binary |
|---|---|---|
| 2^0 | 1 | 1 |
| 2^1 | 2 | 10 |
| 2^2 | 4 | 100 |
| 2^3 | 8 | 1000 |
| 2^4 | 16 | 10000 |
| 2^5 | 32 | 100000 |
| 2^6 | 64 | 1000000 |
| 2^7 | 128 | 10000000 |
| 2^8 | 256 | 100000000 |
| 2^9 | 512 | 1000000000 |
| 2^10 | 1,024 | 10000000000 |
| 2^16 | 65,536 | 10000000000000000 |
Understanding how many bits are in standard data units helps with programming and memory calculations.
| Data Unit | Bits | Max Unsigned Value | All Bits Set |
|---|---|---|---|
| Nibble | 4 | 15 | 1111 |
| Byte | 8 | 255 | 11111111 |
| Word (16-bit) | 16 | 65,535 | 1111111111111111 |
| Double Word (32-bit) | 32 | 4,294,967,295 | 32 ones |
Text is stored as binary in computers. Here are some common ASCII characters and their binary representations.
| Character | Decimal (ASCII) | Binary |
|---|---|---|
| A | 65 | 01000001 |
| B | 66 | 01000010 |
| Z | 90 | 01011010 |
| a | 97 | 01100001 |
| z | 122 | 01111010 |
| 0 | 48 | 00110000 |
| 9 | 57 | 00111001 |
| Space | 32 | 00100000 |
Understanding binary is essential for bitwise operations, flags, permissions, and low-level programming. Languages like C, C++, and assembly require binary knowledge for efficient code.
IP addresses, subnet masks, and CIDR notation all rely on binary. Network engineers must convert between decimal and binary to configure routing and subnetting correctly.
Circuit designers use binary to work with logic gates (AND, OR, NOT, XOR), flip-flops, and memory cells. Every hardware operation fundamentally processes binary signals.
Encryption algorithms, hash functions, and security protocols operate on binary data. Understanding binary is crucial for analyzing vulnerabilities and implementing secure systems.
The most common mistake is reading the remainders in the wrong order. The first remainder you calculate is the least significant bit (rightmost), and the last remainder is the most significant bit (leftmost). Always read from bottom to top.
Knowing 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024 by heart makes mental conversion much faster. You can decompose any number by subtracting the largest fitting power of 2 repeatedly.
Binary 10 is not ten; it is two (1 x 2 + 0). Binary 100 is not one hundred; it is four (1 x 4). Always specify the base when writing numbers to avoid ambiguity, such as writing 10 (base 2) or 10 (base 10).
While 0101 and 101 represent the same value in binary, leading zeros matter when working with fixed-width data types. An 8-bit byte always has 8 digits, so decimal 5 would be 00000101 in an 8-bit context.
After converting decimal to binary, verify your result by converting back. Multiply each binary digit by its power-of-2 position value and sum them. If the total matches the original decimal number, your conversion is correct.
Long binary numbers are hard to read. Group binary digits into sets of 4 (nibbles) for clarity. For example, write 11111111 as 1111 1111, or 10000000000 as 100 0000 0000. Each group of 4 bits also corresponds to one hexadecimal digit.
Binary is the fundamental language of computers because digital circuits can only be in two states: on (1) or off (0). All data in computers, from numbers and text to images and videos, is ultimately stored and processed as binary code.
The number of bits needed is the ceiling of log base 2 of (n+1), where n is the decimal number. For example, 255 requires 8 bits because 2 to the power of 8 minus 1 equals 255. In general, n bits can represent values from 0 to 2^n minus 1.
Zero in binary is simply 0. However, in fixed-width representations such as 8-bit or 16-bit, it is written with leading zeros: 00000000 for 8 bits or 0000000000000000 for 16 bits.
Yes, decimal fractions can be converted to binary fractions. For example, 0.5 in decimal is 0.1 in binary, and 0.25 is 0.01 in binary. However, some decimal fractions like 0.1 cannot be exactly represented in binary, which can lead to floating-point precision issues in programming.
Binary prefixes use powers of 2: kibi (2 to the 10th = 1,024), mebi (2 to the 20th = 1,048,576), gibi (2 to the 30th = 1,073,741,824). These differ from decimal prefixes (1,000, 1,000,000) and are standardized by the IEC to avoid ambiguity in computing contexts.
Binary uses base-2 with digits 0 and 1, while hexadecimal uses base-16 with digits 0-9 and A-F. Each hexadecimal digit maps to exactly 4 binary digits, making hex a convenient shorthand. For example, binary 11111111 is FF in hexadecimal and 255 in decimal.
Computers commonly use a system called two's complement to represent negative numbers. In this system, the leftmost bit indicates the sign (0 for positive, 1 for negative). To negate a number, you flip all bits and add 1. For example, in 8-bit two's complement, -1 is represented as 11111111.
For unsigned (non-negative) integers, 8 bits can store values from 0 to 255 (binary 11111111). For signed integers using two's complement, 8 bits can store values from -128 to 127. This is why an unsigned byte can hold values 0 to 255.
IP addresses are fundamentally binary numbers. An IPv4 address like 192.168.1.1 is actually four 8-bit binary numbers: 11000000.10101000.00000001.00000001. Subnet masks use binary to separate network and host portions of an address, which is essential for routing.
Binary uses only 0 and 1 because electronic circuits are most reliable when distinguishing between just two voltage states: high and low. This simplicity makes hardware design more robust and less prone to errors compared to systems that need to distinguish between multiple voltage levels.
This calculator is provided for educational and informational purposes. Always verify critical calculations independently.