Base 10 to Base 2
Decimal to Binary Converter
Convert decimal numbers to binary online with this free decimal-to-binary calculator. Enter a whole number to get its base-2 representation, see the division-by-two steps, and choose an optional unsigned fixed-width output.
Open converterDecimal to Binary Calculator
Enter a non-negative decimal whole number. The conversion is calculated on the server using decimal-string arithmetic, so it is not restricted to ordinary PHP integer sizes.
How to Convert Decimal to Binary
Decimal is a base-10 number system that uses the digits 0 through 9. Binary is a base-2 number system that uses only 0 and 1. To convert a whole decimal number into binary, repeatedly divide the number by two and record the remainder from each division.
Example: Convert 13 Decimal to Binary
| Division | Quotient | Remainder |
|---|---|---|
| 13 ÷ 2 | 6 | 1 |
| 6 ÷ 2 | 3 | 0 |
| 3 ÷ 2 | 1 | 1 |
| 1 ÷ 2 | 0 | 1 |
Read the remainders from bottom to top:
Therefore, 13 in decimal equals 1101 in binary.
Decimal to Binary Conversion Examples
These examples cover frequently used decimal values and common number-conversion exercises.
| Decimal number | Binary equivalent | Calculation |
|---|---|---|
| 0 | 0 |
0₁₀ = 0₂ |
| 1 | 1 |
1₁₀ = 1₂ |
| 2 | 10 |
2₁₀ = 10₂ |
| 5 | 101 |
5₁₀ = 101₂ |
| 10 | 1010 |
10₁₀ = 1010₂ |
| 12 | 1100 |
12₁₀ = 1100₂ |
| 25 | 11001 |
25₁₀ = 11001₂ |
| 45 | 101101 |
45₁₀ = 101101₂ |
| 100 | 1100100 |
100₁₀ = 1100100₂ |
| 154 | 10011010 |
154₁₀ = 10011010₂ |
| 255 | 11111111 |
255₁₀ = 11111111₂ |
| 256 | 100000000 |
256₁₀ = 100000000₂ |
| 1024 | 10000000000 |
1024₁₀ = 10000000000₂ |
A few common conversions
2 decimal to binary:
2 = 10.
10 decimal to binary:
10 = 1010.
45 decimal to binary:
45 = 101101.
100 decimal to binary:
100 = 1100100.
154 decimal to binary:
154 = 10011010.
Understanding Binary Place Values
Each position in a binary number represents a power of two. Starting from the right, the place values are 2⁰, 2¹, 2², 2³, and so on.
For example, the binary number 1011 can be
expanded as follows:
This means 1011 in binary is equal to
11 in decimal.
Natural-Length vs Fixed-Width Binary
A binary number can be displayed using its natural length or with a specified number of bits. Fixed-width representations add leading zeros without changing the numeric value.
Natural-length output
Displays only the bits needed to represent the number.
For example, decimal 5 becomes 101.
Fixed-width output
Adds leading zeros to reach the selected width.
Decimal 5 in unsigned 8-bit form becomes
00000101.
Related Binary and Number Base Tools
Continue working with binary numbers, hexadecimal values, and other number systems using these related tools.
Binary to Decimal Converter
Convert binary numbers into decimal values.
Number Base Converter
Convert numbers between common number systems.
Binary to Hexadecimal Converter
Convert base-2 values into hexadecimal.
Hexadecimal to Binary Converter
Convert hexadecimal values into binary.
Binary Addition Calculator
Add binary numbers and inspect the result.
Binary String Validator
Check whether a string contains valid binary digits.
Frequently Asked Questions
How do I convert decimal to binary?
Repeatedly divide the decimal whole number by two and record each remainder. Continue until the quotient is zero. Read the remainders in reverse order to obtain the binary representation.
What is 2 decimal to binary?
Decimal 2 is binary 10. The binary digit 1
represents 2¹, which equals 2 in decimal.
What is 45 decimal to binary?
Decimal 45 is binary 101101.
This represents 32 + 8 + 4 + 1 = 45.
What is 100 decimal to binary?
Decimal 100 is binary 1100100.
This represents 64 + 32 + 4 = 100.
Can this converter process large decimal numbers?
Yes. The converter uses decimal-string arithmetic instead of converting the entire input into a PHP integer. It accepts up to 4,000 decimal digits, subject to your hosting environment's execution and memory limits.
Can I convert decimal fractions?
This page converts non-negative whole numbers only. Decimal fractions require a separate method based on repeated multiplication by two.
What happens if a number does not fit in 8 bits?
The calculator displays an error rather than truncating the number. For example, decimal 256 requires nine bits and cannot fit into an unsigned 8-bit representation.
Do leading zeros change a binary number's value?
No. Leading zeros do not change the numeric value.
For example, 00000101 and 101
both represent decimal 5.
Explore More Binary Calculators
Convert numbers, work with bits, and explore the foundations of digital computing.
Browse all Binarios.org tools