Decimal to Binary Converter
Convert a decimal integer to binary instantly with an exact base-10 to base-2 converter. Enter any non-negative whole number to get its binary representation, bit length, power-of-two breakdown, and verified examples.
What Is a Decimal to Binary Converter?
A decimal to binary converter changes an integer written in the familiar decimal number system (base 10) into the equivalent binary number system (base 2). Decimal uses digits 0–9, while binary uses only 0 and 1.
Binary is fundamental to computing because digital systems can represent two logical states naturally. Each position in a binary number corresponds to a power of two, just as each decimal position corresponds to a power of ten.
BinaryCon performs integer conversion directly in the browser and uses arbitrary-size integer arithmetic for large values. This avoids rounding problems that can occur when very large integers are forced into ordinary floating-point numbers.
Decimal system
Base 10 uses digits 0 through 9 and place values 1, 10, 100, 1000, and so on.
Binary system
Base 2 uses only 0 and 1 with place values 1, 2, 4, 8, 16, 32, and so on.
How to Use the Decimal to Binary Converter
Type a whole number such as 45. This tool is designed for
non-negative decimal integers.
BinaryCon calculates the exact base-2 representation and updates the result automatically for valid input.
The result displays the complete binary representation without scientific notation or integer rounding.
The result card reports how many significant binary digits are required to represent the decimal integer.
Use the binary output in programming, digital logic, coursework, documentation, or another BinaryCon converter.
How Decimal to Binary Conversion Works
There are two common ways to understand decimal-to-binary conversion: repeated division by 2 and decomposition into powers of two.
In the repeated-division method, divide the decimal number by 2 repeatedly and record each remainder. Because division by 2 produces a remainder of either 0 or 1, those remainders become the binary digits.
Read the remainders from bottom to top to obtain the final binary value.
Worked Example: Convert Decimal 45 to Binary
Decimal 45 can be expressed as a sum of powers of two.
Repeated Division Example for Decimal 45
| Division | Quotient | Remainder |
|---|---|---|
| 45 ÷ 2 | 22 | 1 |
| 22 ÷ 2 | 11 | 0 |
| 11 ÷ 2 | 5 | 1 |
| 5 ÷ 2 | 2 | 1 |
| 2 ÷ 2 | 1 | 0 |
| 1 ÷ 2 | 0 | 1 |
Reading the remainder column from bottom to top gives
101101.
Decimal to Binary Conversion Table
| Decimal | Binary | Decimal | Binary |
|---|---|---|---|
| 0 | 0 | 8 | 1000 |
| 1 | 1 | 9 | 1001 |
| 2 | 10 | 10 | 1010 |
| 3 | 11 | 11 | 1011 |
| 4 | 100 | 12 | 1100 |
| 5 | 101 | 13 | 1101 |
| 6 | 110 | 14 | 1110 |
| 7 | 111 | 15 | 1111 |
| 16 | 10000 | 32 | 100000 |
| 64 | 1000000 | 128 | 10000000 |
| 255 | 11111111 | 256 | 100000000 |
| 512 | 1000000000 | 1024 | 10000000000 |
Important Powers of Two
Knowing common powers of two makes decimal-to-binary conversion easier to estimate and verify.
| Power | Decimal | Binary |
|---|---|---|
| 2⁰ | 1 | 1 |
| 2¹ | 2 | 10 |
| 2² | 4 | 100 |
| 2³ | 8 | 1000 |
| 2⁴ | 16 | 10000 |
| 2⁵ | 32 | 100000 |
| 2⁶ | 64 | 1000000 |
| 2⁷ | 128 | 10000000 |
| 2⁸ | 256 | 100000000 |
| 2¹⁰ | 1,024 | 10000000000 |
| 2¹⁶ | 65,536 | 1 followed by 16 zeros |
How Many Bits Are Needed for a Decimal Number?
A positive decimal integer needs enough binary positions to include its highest power of two. For a positive integer n, the number of significant bits is:
Examples:
| Decimal Range | Bits Needed | Largest Value |
|---|---|---|
| 0–1 | 1 | 1 |
| 2–3 | 2 | 3 |
| 4–7 | 3 | 7 |
| 8–15 | 4 | 15 |
| 16–31 | 5 | 31 |
| 128–255 | 8 | 255 |
| 256–511 | 9 | 511 |
What Happens With Leading Zeros?
A normal unsigned binary representation usually omits unnecessary leading
zeros. Decimal 5 is therefore displayed as 101, not
00000101.
In computing, however, a fixed-width representation may be required. For example:
Significant binary: 101
8-bit form: 00000101
16-bit form: 0000000000000101
These patterns all have the same unsigned numeric value. The additional leading zeros specify storage or display width rather than a different number.
Why Decimal 255 Is Important in Binary
Decimal 255 is a common reference value because it is the maximum unsigned value that fits in eight bits.
This value appears frequently in byte-oriented computing, RGB color channels, subnetting examples, masks, and low-level programming.
Where Decimal to Binary Conversion Is Used
Programming
Developers convert integers to binary to inspect flags, bit masks, permissions, register values, and packed data.
Digital electronics
Decimal values may need to be represented as binary signals for logic circuits, counters, registers, and embedded systems.
Networking
Binary representations are useful for understanding subnet masks, address bits, prefix boundaries, and protocol fields.
Computer science education
Decimal-to-binary exercises teach positional notation, powers of two, integer storage, and digital number representation.
Common Decimal to Binary Conversion Mistakes
With repeated division by 2, the remainders must be read from the last division back to the first.
If a power of two is not present in the decimal sum, its binary position must still be represented by 0 between active positions.
Binary output may contain only 0 and 1. A character such as 2 is never a valid binary digit.
This calculator outputs an unsigned binary magnitude. Negative numbers require a chosen signed representation such as two’s complement and a defined bit width.
Related BinaryCon Tools
Reverse the conversion or convert the same decimal integer to other number systems using these related tools.
Decimal to Binary Converter FAQs
How do you convert decimal to binary?
Divide the decimal integer repeatedly by 2 and record each remainder. Continue until the quotient becomes zero, then read the remainders from bottom to top. Alternatively, express the number as a sum of powers of two and mark each included power with a binary 1.
What is decimal 10 in binary?
Decimal 10 equals 1010₂. The value can be written as 8 + 2, so the 8 and 2 binary positions contain 1 while the 4 and 1 positions contain 0.
What is decimal 45 in binary?
Decimal 45 equals 101101₂. The active powers are 32, 8, 4, and 1, and 32 + 8 + 4 + 1 = 45.
What is decimal 255 in binary?
Decimal 255 is 11111111₂. It is the largest unsigned value representable with eight bits because 2⁸ – 1 = 255.
What is decimal 1024 in binary?
Decimal 1024 equals 10000000000₂. Since 1024 = 2¹⁰, its binary representation is one 1 followed by ten zeros.
Why do we divide by 2 when converting decimal to binary?
Binary is base 2. Repeated division by the base separates a number into base-2 digits. Each division by 2 produces a remainder of either 0 or 1, which is exactly the set of valid binary digits.
How many bits are needed to represent decimal 255?
Eight bits are needed. Binary 255 is 11111111. Eight
unsigned bits can represent values from 0 through 255.
Is binary 101 the same as decimal 101?
No. Binary 101₂ equals decimal 5 because its active place
values are 4 and 1. Decimal 101 written in binary is
1100101₂.
Does adding leading zeros change a binary value?
No for an unsigned integer. 101, 0101, and
00000101 all represent decimal 5. Leading zeros are often
added only to fit a fixed bit width.
Can this converter handle very large decimal integers?
Yes. The calculator uses JavaScript BigInt for integer conversion instead of ordinary floating-point arithmetic, allowing very large whole numbers to be converted exactly without the standard safe-integer rounding issue.
Can I convert negative decimal numbers to binary here?
This page converts non-negative decimal integers to their unsigned binary magnitude. A negative integer requires a signed representation and a specified width, such as 8-bit or 16-bit two’s complement.
Does this converter support decimal fractions?
This tool is designed for whole-number integers. Decimal fractions require a separate fractional conversion process using repeated multiplication by 2, and some decimal fractions produce repeating binary expansions rather than a finite number of binary digits.
Why do computers use binary instead of decimal?
Digital electronic systems can reliably distinguish two physical or logical states, making binary representation practical for storing and processing information. Complex numbers, text, images, and instructions can all be encoded using combinations of bits.
Convert Decimal Numbers to Binary Instantly
Use BinaryCon for exact decimal-to-binary conversion, verified powers-of-two examples, bit-length information, and practical number-system tools without registration.