Decimal to Binary: The Complete Guide to Conversion, Methods, Examples, and Binary Representation
Decimal to Binary conversion is the process of representing a number from the base-10 number system in the base-2 number system.
The decimal number 13, for example, is represented as 1101 in binary:
13₁₀ = 1101₂
The value has not changed. Only its representation has changed.
Decimal-to-binary conversion is a fundamental concept in computing, programming, digital electronics, networking, and computer science because computers represent integer data using binary digits, or bits.
There are several ways to approach the conversion. For whole positive numbers, the most common manual method is repeated division by 2. Another useful approach is to identify the powers of 2 that make up the decimal number. Understanding binary place values also makes it possible to convert a result back to decimal and verify that it is correct.
This guide explains all of these methods, including how decimal fractions and negative numbers require different treatment, how binary representation relates to bit width, and how to use an online decimal-to-binary converter when you only need the result.
Decimal and Binary: Two Different Number Systems
Before converting between decimal and binary, it helps to understand what makes the two systems different.
The Decimal Number System
The decimal system is base 10. It uses ten digits:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9
Each position represents a power of 10.
For example, consider:
583
Its value can be expanded as:
5 × 10² + 8 × 10¹ + 3 × 10⁰
Which gives:
500 + 80 + 3 = 583
The position of each digit determines its value.
The Binary Number System
Binary is base 2. It uses only two digits:
0 and 1
Instead of powers of 10, binary positions represent powers of 2.
For example:
1101₂
can be expanded as:
1 × 2³ + 1 × 2² + 0 × 2¹ + 1 × 2⁰
Therefore:
8 + 4 + 0 + 1 = 13
So:
1101₂ = 13₁₀
This positional structure is the foundation of decimal-to-binary conversion.
Why Do Computers Use Binary?
Computers and digital electronic systems operate using physical states that can be represented by two distinct conditions.
These conditions can be represented logically as:
0 and 1
A binary digit is called a bit.
A bit therefore has two possible values:
01
Groups of bits can represent larger values and more complex information.
This is why binary is fundamental to digital computing. It provides a numerical system that maps naturally to two-state digital logic.
However, this does not mean that every number a programmer or user sees is normally written in binary. Decimal is much more convenient for people, so software frequently displays values in decimal while the underlying representation can be binary.
What Does Decimal-to-Binary Conversion Actually Do?
Decimal-to-binary conversion does not translate each decimal digit individually.
For example, converting 13 does not mean converting the digit 1 and the digit 3 separately.
Instead, conversion finds the combination of binary positional values that produces the same numerical value.
For 13:
13 = 8 + 4 + 1
And those values correspond to:
2³ + 2² + 2⁰
Therefore:
13₁₀ = 1101₂
This distinction is important because decimal and binary use different positional systems.
The conversion is therefore a change of representation, not a change of numerical value.
How to Convert Decimal to Binary
For a positive whole decimal number, the standard manual technique is repeated division by 2.
The method works because dividing an integer by 2 produces a remainder of either:
0 or 1
Those remainders become the binary digits.
The repeated-division process
- Divide the decimal number by 2.
- Record the quotient and remainder.
- Take the quotient and divide it by 2 again.
- Continue until the quotient becomes 0.
- Read the remainders from bottom to top.
The reason for reading them backwards becomes clear once we examine an example.
Example: Convert 13 to Binary
Start with 13.
| Step | Calculation | Quotient | Remainder |
| 1 | 13 ÷ 2 | 6 | 1 |
| 2 | 6 ÷ 2 | 3 | 0 |
| 3 | 3 ÷ 2 | 1 | 1 |
| 4 | 1 ÷ 2 | 0 | 1 |
The remainders were produced in this order:
1, 0, 1, 1
But the binary result is:
1101
So:
13₁₀ = 1101₂
The final division is essential:
1 ÷ 2 = 0 remainder 1
That final remainder becomes the leftmost binary digit.
Why Are the Remainders Read From Bottom to Top?
This is one of the most important parts of the conversion method.
The first division determines the least significant bit, which is the rightmost position.
The next division determines the next bit to the left.
The process therefore discovers the binary digits in this direction:
right → left
But binary numbers are normally written:
left → right
So the remainders have to be reversed before they become the final binary representation.
For 13, the division process produces:
1 → 0 → 1 → 1
Reading backwards gives:
1 → 1 → 0 → 1
Therefore:
1101₂
This is not an arbitrary rule. It follows directly from the positional structure of binary numbers.
Understanding Binary Place Values
Binary positions are powers of 2.
Starting from the rightmost position:
| Position | Power of 2 | Decimal Value |
| Rightmost | 2⁰ | 1 |
| 2nd from right | 2¹ | 2 |
| 3rd from right | 2² | 4 |
| 4th from right | 2³ | 8 |
| 5th from right | 2⁴ | 16 |
| 6th from right | 2⁵ | 32 |
| 7th from right | 2⁶ | 64 |
| 8th from right | 2⁷ | 128 |
The values double as you move one position to the left.
A binary 1 means that the corresponding power of 2 is included.
A binary 0 means that it is not.
Example: 1101
Consider:
1101₂
| Binary Digit | Power | Contribution |
| 1 | 2³ | 8 |
| 1 | 2² | 4 |
| 0 | 2¹ | 0 |
| 1 | 2⁰ | 1 |
Adding the contributions:
8 + 4 + 0 + 1 = 13
Therefore:
1101₂ = 13₁₀
This is also why the powers-of-two method works.
Method 2: Convert Decimal to Binary
Using Powers of 2
Instead of repeatedly dividing by 2, you can build the binary number from the largest powers of 2 that fit into the decimal value.
This method works from left to right, unlike repeated division, which discovers the bits from right to left.
Consider the decimal number:
45
The powers of 2 around this value are:
1, 2, 4, 8, 16, 32, 64
Since 64 is larger than 45, start with 32.
Step 1: Use 32
45 − 32 = 13
So the 32 position receives a 1.
Step 2: Check 16
16 is greater than the remaining 13.
So the 16 position receives a 0.
Step 3: Use 8
13 − 8 = 5
The 8 position receives a 1.
Step 4: Use 4
5 − 4 = 1
The 4 position receives a 1.
Step 5: Check 2
2 is greater than the remaining 1.
So the 2 position receives a 0.
Step 6: Use 1
1 − 1 = 0
The 1 position receives a 1.
The complete representation is:
| Power of 2 | 32 | 16 | 8 | 4 | 2 | 1 |
| Binary Digit | 1 | 0 | 1 | 1 | 0 | 1 |
Therefore:
45₁₀ = 101101₂
The calculation can also be written as:
45 = 32 + 8 + 4 + 1
or:
45 = 2⁵ + 2³ + 2² + 2⁰
Both methods produce the same binary representation.
Repeated Division vs. Powers of 2
Both methods are mathematically equivalent, but they are useful in slightly different situations.
| Method | How It Works | Main Advantage |
| Repeated division | Divide by 2 and record remainders | Systematic and reliable |
| Powers of 2 | Select powers that add up to the number | Makes binary place values easier to understand |
Repeated division is often easier when converting an unfamiliar or larger integer manually.
The powers-of-two method can be faster for smaller values when you already know the common powers of 2.
Neither method changes the numerical value. They simply approach the same representation from different directions.
How to Convert Binary Back to Decimal
Understanding the reverse conversion is useful because it gives you a reliable way to verify a decimal-to-binary result.
To convert binary to decimal:
- Assign each digit its corresponding power of 2.
- Multiply each binary digit by its place value.
- Add the resulting values.
Example: Convert 1100100 to Decimal
Start with:
1100100₂
| Binary Digit | Power of 2 | Contribution |
| 1 | 2⁶ | 64 |
| 1 | 2⁵ | 32 |
| 0 | 2⁴ | 0 |
| 0 | 2³ | 0 |
| 1 | 2² | 4 |
| 0 | 2¹ | 0 |
| 0 | 2⁰ | 0 |
Now add the contributions:
64 + 32 + 4 = 100
Therefore:
1100100₂ = 100₁₀
If your binary result converts back to the original decimal number, the conversion is correct.
Decimal-to-Binary Examples
Once the underlying method is understood, several common values are useful as reference points.
| Decimal | Binary | Verification |
| 5 | 101 | 4 + 1 |
| 10 | 1010 | 8 + 2 |
| 13 | 1101 | 8 + 4 + 1 |
| 16 | 10000 | 16 |
| 25 | 11001 | 16 + 8 + 1 |
| 42 | 101010 | 32 + 8 + 2 |
| 45 | 101101 | 32 + 8 + 4 + 1 |
| 100 | 1100100 | 64 + 32 + 4 |
| 128 | 10000000 | 128 |
| 255 | 11111111 | 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 |
| 256 | 100000000 | 256 |
| 1024 | 10000000000 | 1024 |
These examples reveal several useful patterns.
Binary Patterns Worth Knowing
You do not need to memorize hundreds of decimal-to-binary conversions. Understanding a few patterns makes conversion much easier.
Powers of 2
A power of 2 has a 1 followed by zeros:
| Decimal | Binary |
| 2 | 10 |
| 4 | 100 |
| 8 | 1000 |
| 16 | 10000 |
| 32 | 100000 |
| 64 | 1000000 |
| 128 | 10000000 |
| 256 | 100000000 |
| 1024 | 10000000000 |
This happens because each additional binary position represents another power of 2.
Numbers One Less Than a Power of 2
Numbers immediately below a power of 2 have all lower positions set to 1.
For example:
15 = 2⁴ − 1
so:
15₁₀ = 1111₂
Similarly:
31₁₀ = 11111₂
63₁₀ = 111111₂
255₁₀ = 11111111₂
These patterns are particularly important when working with bit masks and maximum values for fixed-width unsigned integers.
Binary Representation and Bit Width
A binary number's value and its representation width are not the same thing.
Consider decimal 13.
Its ordinary binary representation is:
1101
But the same value can be represented using eight positions:
00001101
The leading zeros do not change the value.
They simply make the representation eight bits wide.
This distinction becomes important in programming and computer systems because an integer may be stored or displayed using a specific width such as:
- 8 bits
- 16 bits
- 32 bits
- 64 bits
For example, the unsigned 8-bit range is:
0 to 255
because eight binary positions can represent:
2⁸ = 256
different values, from 0 through 255.
An ordinary decimal-to-binary conversion does not automatically imply a particular bit width.
How to Convert Decimal Fractions to Binary
Converting a whole number such as 13 to binary uses repeated division by 2.
Decimal fractions require a different process.
For the fractional part, the common method is repeated multiplication by 2.
Consider a simple example such as:
0.625₁₀
Multiply the fractional value by 2:
0.625 × 2 = 1.25
The integer part is 1.
Continue with the fractional part:
0.25 × 2 = 0.5
The integer part is 0.
Continue:
0.5 × 2 = 1.0
The integer part is 1.
Reading those integer parts from top to bottom gives:
101
Therefore:
0.625₁₀ = 0.101₂
The important point is that the method changes after the binary point.
For whole numbers, repeated division by 2 produces the bits.
For fractional parts, repeated multiplication by 2 produces the bits.
Some decimal fractions have finite binary representations, while others produce repeating binary expansions.
This is one reason decimal-to-binary conversion should not be treated as a single procedure for every possible decimal value.
How Negative Decimal Numbers Are Represented in Binary
Negative numbers introduce another issue: how should the negative sign be represented?
A simple binary sequence contains only 0 and 1, so a signed representation needs a defined convention.
One widely used approach is two's complement.
Two's-complement representation depends on a fixed number of bits.
For example, the representation of a negative integer in an 8-bit system is different from its representation in a 16-bit system.
This is why converting a negative decimal number to binary is not simply a matter of applying the positive-number division method and adding a minus sign.
The representation depends on the signed-number convention and the selected bit width.
The OnlineToolPot Decimal to Binary Converter focuses on positive whole numbers and does not perform signed two's-complement conversion.
Converting Large Decimal Numbers to Binary
The mathematical principle does not change when the decimal number becomes larger.
A large positive integer can still be converted through repeated division by 2 or decomposition into powers of 2.
The practical difference is that larger values require more binary positions and, in software, require appropriate integer handling.
JavaScript's BigInt type is designed for integers larger than the range that can be represented safely by the ordinary JavaScript Number type.
For technical reference, Google's developer documentation provides information about JavaScript BigInt:
Google Developers — JavaScript BigInt
For OnlineToolPot's converter, large positive integer input is handled using BigInt when the input exceeds the range where ordinary JavaScript numbers provide exact integer representation.
The converter accepts input up to 100 digits.
Decimal to Binary in Programming
Binary conversion is especially useful in programming when a decimal integer needs to be understood at the individual-bit level.
Bitwise operations
Programming languages provide operations such as:
- AND
- OR
- XOR
- NOT
- left shift
- right shift
Seeing the binary representation makes these operations easier to reason about.
For example, if a decimal integer is converted to binary, you can immediately see which bit positions contain 1.
Bit masks
A bit mask uses specific positions to select or modify individual bits.
Understanding decimal-to-binary conversion makes it easier to see what a mask actually represents.
Flags
Programs sometimes store several yes/no states inside a single integer by assigning each state to a different bit.
Binary makes those individual states visible.
In all three cases, conversion is useful because it exposes the underlying bit pattern rather than treating the integer as a single decimal value.
Decimal to Binary in Networking
Networking provides another practical use for binary representation.
IPv4 addresses are normally written using four decimal octets, such as:
192.168.1.10
Each octet represents an 8-bit value.
For example:
255₁₀ = 11111111₂
and:
128₁₀ = 10000000₂
Understanding the binary form of an octet becomes particularly useful when working with:
- subnet masks
- network addresses
- broadcast addresses
- address ranges
- subnetting calculations
The decimal notation is convenient for reading addresses, while binary reveals the individual bits used in network calculations.
Decimal to Binary in Digital Electronics
Digital systems use two-state logic, commonly represented as 0 and 1.
Binary therefore provides a natural way to describe:
- logic states
- bit patterns
- digital values
- binary counters
- register contents
For someone learning digital electronics, converting decimal values to binary helps connect an ordinary numerical value with the individual binary states used by digital circuits.
Common Decimal-to-Binary Conversion Mistakes
Reading the remainders in the wrong direction
This is probably the most common error in repeated division.
For 13, the remainders appear as:
1 → 0 → 1 → 1
But the final binary representation is:
1101
because the first remainder is the least significant bit.
Stopping too early
The division process continues until the quotient becomes 0.
Stopping when the quotient becomes 1 and failing to perform the final division can remove the most significant bit.
Skipping a power of 2
When using the powers-of-two method, every relevant position must be considered.
For 45:
32, 16, 8, 4, 2, 1
The 16 and 2 positions are both 0.
Skipping either position entirely can shift the remaining digits into the wrong places.
Treating decimal digits as separate values
The decimal number 45 is not converted by separately converting 4 and 5.
The entire numerical value must be represented using powers of 2.
Confusing leading zeros with additional value
Adding zeros to the left does not increase a binary number's value.
101
and:
00000101
both represent decimal 5.
Assuming every binary conversion is fixed-width
An ordinary binary conversion does not automatically mean 8-bit, 16-bit, 32-bit, or 64-bit output.
Bit width matters when a particular storage or representation format requires it.
How to Check Whether a Decimal-to-Binary Conversion Is Correct
There are two practical ways to check a result.
Check using powers of 2
Take every 1 in the binary number and add its corresponding power of 2.
For:
101101₂
the calculation is:
32 + 8 + 4 + 1 = 45
Therefore:
101101₂ = 45₁₀
Convert the result back to decimal
You can also perform the complete binary-to-decimal calculation.
This is particularly useful when checking a longer binary value where it is easy to lose track of a position.
The key test is simple:
If converting the binary result back produces the original decimal value, the conversion is consistent.
Decimal to Binary Converter: When to Use an Online Tool
Manual conversion is valuable when you are learning the number system or need to show the calculation.
An online converter is more convenient when:
- you need a result quickly;
- you are checking a manual calculation;
- you are working with a large integer;
- you need to convert several values;
- you do not need to show the intermediate division steps.
A good converter should also make its input limitations clear.
For example, a tool that accepts only positive whole numbers should not imply that it handles fractional or signed conversion.
Online ToolPot Decimal to Binary Converter
The Online ToolPot converter is designed for direct conversion of positive whole decimal numbers into their ordinary binary representation.
It performs the conversion in the browser and updates the result as the input changes.
Supported capabilities
| Capability | Status |
| Positive whole-number input | Supported |
| Decimal-to-binary conversion | Supported |
| Live conversion | Supported |
| Copy Input | Supported |
| Copy Result | Supported |
| Clear | Supported |
| Browser-side processing | Supported |
| Maximum input length | 100 digits |
| Large integer handling with BigInt | Supported |
| Decimal fractions | Not supported |
| Negative numbers | Not supported |
| Fixed-width output | Not supported |
| Two's-complement conversion | Not supported |
| Step-by-step division display | Not supported |
This makes the tool suitable when the requirement is straightforward:
decimal whole number → ordinary binary representation
It is not intended to replace specialized signed-integer, fractional, or fixed-width binary conversion tools.
Use the OnlineToolPot Decimal to Binary Converter
Decimal to Binary Conversion: Final Takeaway
Decimal-to-binary conversion is fundamentally a change from base 10 positional notation to base 2 positional notation.
For positive whole numbers, two methods are especially useful.
Repeated division by 2
Divide by 2 repeatedly, record each remainder, and read the remainders from bottom to top.
Powers of 2
Find the powers of 2 that add up to the decimal value and place a 1 in those positions while using 0 for the positions that are skipped.
Both methods produce the same result because both are expressing the same numerical value through binary place values.
For example:
45₁₀ = 101101₂
because:
45 = 32 + 8 + 4 + 1
The same principles extend into programming, networking, digital electronics, and computer science, although signed numbers, fractions, and fixed-width representations require additional rules.
If you need to convert a positive whole decimal number without performing the calculation manually, the OnlineToolPot converter provides the direct result in your browser.






