Decimal to Binary Converter
Convert decimal numbers to binary instantly and see the repeated division method behind
the answer. Enter a base-10 integer such as 25, 255, or
1024; the calculator returns the base-2 form and shows the conversion rule
\(N_{10}\rightarrow N_2\).
Convert Decimal to Binary
Commas, spaces, and underscores are ignored. Whole numbers are converted exactly with integer arithmetic. Fractional parts are expanded to a practical binary display.
Decimal to Binary Formula
The standard whole-number method repeatedly divides the decimal number by 2, records each remainder, and reads the remainders from bottom to top.
Each remainder \(r_i\) is either 0 or 1. The binary number is the sequence of remainders read in reverse order:
What Is a Decimal to Binary Converter?
A decimal to binary converter changes a number written in base 10 into the equivalent number written in base 2. Decimal is the everyday number system that uses the ten digits 0 through 9. Binary is the two-digit number system that uses only 0 and 1. The value is unchanged; only the notation changes. For example, \(25_{10}\) and \(11001_2\) represent the same quantity, just as "twenty-five" and "25" are different ways of writing the same value.
This page is focused on the direct base-10 to base-2 conversion. If you already have a binary number and need its decimal value, use the binary to decimal converter for the reverse direction. Keeping the direction clear matters because the algorithms are different: decimal to binary is usually taught with repeated division by 2, while binary to decimal is usually taught with powers-of-2 place value.
The calculator is useful for students, teachers, programmers, electronics learners, networking practice, and anyone checking how a base-10 value is represented as bits. It gives the answer quickly, but the guide below explains the method so the result is not a black box. When a worksheet or exam asks for working, you can use the repeated division steps and then verify the answer with powers of 2.
Decimal and Binary Number Systems
Decimal is a positional number system with base 10. Every position is a power of 10. The number \(4{,}372_{10}\) means \(4\times10^3+3\times10^2+7\times10^1+2\times10^0\). The rightmost digit is the ones place, the next digit is the tens place, the next is hundreds, and the pattern continues by multiplying by 10 each time you move left.
Binary is also positional, but its base is 2 instead of 10. Every position is a power of 2. The binary number \(1011_2\) means \(1\times2^3+0\times2^2+1\times2^1+1\times2^0\). That equals \(8+0+2+1=11_{10}\). The digits look similar to decimal digits, but the place values are completely different. The subscript \(2\) is a reminder that the number is being read in base 2.
Computers use binary because electronic circuits are naturally good at representing two stable states: low or high voltage, off or on, false or true, 0 or 1. A single binary digit is called a bit. Groups of bits can represent integers, instructions, memory addresses, text, colors, images, sound, and network packets. Decimal remains easier for ordinary human arithmetic, so conversion between decimal and binary is a core skill in computer science and digital electronics.
Binary can look long because base 2 has fewer digit symbols than base 10. Decimal 255 is only three digits, but its binary form is \(11111111_2\). That extra length is not a weakness; it is the natural result of using only two digit choices. Each additional bit doubles the number of possible values.
Decimal to Binary Formula
There are two common ways to describe decimal-to-binary conversion. The first is the repeated division method. Divide the decimal number by 2, record the remainder, divide the quotient by 2, and continue until the quotient becomes 0. The remainders are the binary digits from right to left.
The remainder \(r\) tells you the current least significant bit. If the number is even, the remainder is 0. If the number is odd, the remainder is 1. Repeating the process extracts the next bit, then the next bit, until the whole number has been decomposed into powers of 2.
The second way is the powers-of-2 method. Find which powers of 2 add up to the decimal number. Then put a 1 in each used power position and a 0 in each unused position. For example, decimal 25 can be written as \(16+8+1\). The powers \(16\), \(8\), and \(1\) are used; \(4\) and \(2\) are not used. Therefore \(25_{10}=11001_2\).
Both methods are correct. The repeated division method is systematic and works well for any whole number. The powers-of-2 method is useful for mental checking, especially when the number is close to a known power such as 16, 32, 64, 128, 256, 512, or 1024.
Step-by-Step Repeated Division Method
The repeated division method is the standard classroom algorithm for converting decimal integers to binary. It is reliable because every whole number has a unique quotient and remainder when divided by 2. Since the divisor is 2, the remainder can only be 0 or 1, which makes it exactly one binary digit.
For example, convert \(13_{10}\) to binary. Start with 13. Divide by 2: \(13\div2=6\) remainder 1. Then divide the quotient 6 by 2: \(6\div2=3\) remainder 0. Continue: \(3\div2=1\) remainder 1, and \(1\div2=0\) remainder 1. The remainders in order of calculation are 1, 0, 1, 1. Read them from bottom to top and the answer is \(1101_2\).
Always remember that the first remainder is the rightmost binary digit, not the leftmost digit. That is the most common mistake in this method. The last remainder becomes the leftmost bit because it corresponds to the largest power of 2 used in the number.
Worked Decimal to Binary Examples
Example 1: Convert 10 to binary
Divide 10 by 2 and record each remainder:
Read the remainders from bottom to top: 1, 0, 1, 0. Therefore:
Check the result by converting back: \(1010_2=8+0+2+0=10_{10}\).
Example 2: Convert 25 to binary
Use repeated division by 2:
Read upward: 1, 1, 0, 0, 1. Therefore \(25_{10}=11001_2\). A powers-of-2 check gives \(16+8+1=25\), matching the binary digits \(1,1,0,0,1\).
Example 3: Convert 64 to binary
Decimal 64 is a power of 2: \(64=2^6\). A pure power of 2 is written as 1 followed by zeros in binary. Since the exponent is 6, there are six zeros after the 1:
This shortcut is useful for values such as 8, 16, 32, 64, 128, 256, 512, and 1024. Each one has a binary form with one 1-bit and the rest 0-bits.
Example 4: Convert 127 to binary
Decimal 127 is one less than 128, and \(128=2^7\). One less than a power of 2 is a string of 1s in binary. Since \(2^7\) is involved, seven 1s are needed:
Check: \(64+32+16+8+4+2+1=127\). This pattern is common for maximum unsigned values.
Example 5: Convert 255 to binary
Decimal 255 is \(2^8-1\). It is the largest value that can fit in an 8-bit unsigned byte, so all eight bits are set to 1:
This value appears frequently in programming, color channels, subnet masks, and byte-level data. The related value \(256_{10}=100000000_2\) needs nine bits because it is one more than the maximum 8-bit unsigned value.
Example 6: Convert 1024 to binary
Decimal 1024 is \(2^{10}\). A power of 2 converts to a 1 followed by the number of zeros equal to the exponent:
The result has 11 binary digits: one leading 1 and ten zeros. This value is useful because \(2^{10}\) is a common reference point in computing and memory-size discussions.
Decimal to Binary Conversion Table
Use this table to check common decimal integers quickly. For larger numbers, the same repeated division method and powers-of-2 checks still apply.
| Decimal | Binary | Useful check |
|---|---|---|
| 0 | 0 | Zero remains zero in every base |
| 1 | 1 | \(2^0=1\) |
| 2 | 10 | \(2^1=2\) |
| 3 | 11 | \(2+1=3\) |
| 4 | 100 | \(2^2=4\) |
| 5 | 101 | \(4+1=5\) |
| 8 | 1000 | \(2^3=8\) |
| 10 | 1010 | \(8+2=10\) |
| 15 | 1111 | \(2^4-1=15\) |
| 16 | 10000 | \(2^4=16\) |
| 32 | 100000 | \(2^5=32\) |
| 64 | 1000000 | \(2^6=64\) |
| 100 | 1100100 | \(64+32+4=100\) |
| 128 | 10000000 | \(2^7=128\) |
| 255 | 11111111 | \(2^8-1=255\) |
| 256 | 100000000 | \(2^8=256\) |
| 512 | 1000000000 | \(2^9=512\) |
| 1024 | 10000000000 | \(2^{10}=1024\) |
Powers of 2 Reference
Memorizing the first powers of 2 makes decimal-to-binary conversion much faster. These values are the binary place values used to build a number. If a decimal number can be expressed as a sum of selected powers, the selected powers become 1-bits and the skipped powers become 0-bits.
| Power | Decimal value | Binary place meaning |
|---|---|---|
| \(2^0\) | 1 | Rightmost integer bit |
| \(2^1\) | 2 | Second bit from the right |
| \(2^2\) | 4 | Third bit from the right |
| \(2^3\) | 8 | Four-bit boundary |
| \(2^4\) | 16 | Start of the next nibble |
| \(2^5\) | 32 | Common flag and ASCII reference |
| \(2^6\) | 64 | Often used in byte values |
| \(2^7\) | 128 | Highest bit in an 8-bit byte |
| \(2^8\) | 256 | One above 8-bit unsigned range |
| \(2^9\) | 512 | Common memory reference |
| \(2^{10}\) | 1024 | Often remembered as about one thousand |
| \(2^{16}\) | 65536 | One above 16-bit unsigned range |
A quick manual strategy is to find the largest power of 2 that does not exceed the decimal number. Put a 1 in that place, subtract the power, then repeat with the remainder. For decimal 45, the largest power is 32. The remainder is 13. Then use 8, skip 4? No: 13 includes 8, then 4, then 1. So \(45=32+8+4+1\), giving \(101101_2\).
Bit Width, Bytes, and Leading Zeros
Leading zeros do not change the numeric value of a binary number. Decimal 5 converts to \(101_2\), but the same value can be written as \(0101_2\), \(00000101_2\), or with more leading zeros if a fixed width is required. All of these represent decimal 5 as an unsigned value.
Fixed width matters in computing because systems store values in fields of specific sizes. A nibble is 4 bits. A byte is 8 bits. A 16-bit word has 16 bits. If a data format requires one byte, decimal 5 is usually displayed as \(00000101_2\) rather than \(101_2\), because the leading zeros show the full byte layout.
For 8 bits, the possible unsigned values run from 0 to \(2^8-1=255\). For 16 bits, they run from 0 to \(2^{16}-1=65535\). This is why the binary form of 255 is eight 1s and the binary form of 65535 is sixteen 1s.
Decimal Fractions to Binary
Decimal-to-binary conversion can also apply to fractional values. The integer part is converted with the division method. The fractional part is converted by repeated multiplication by 2. Multiply the fractional part by 2, record the integer part of the result as the next binary digit, keep the new fractional part, and repeat.
Therefore \(0.625_{10}=0.101_2\). If the number is \(12.625_{10}\), convert the integer part \(12_{10}=1100_2\) and the fractional part \(0.625_{10}=0.101_2\). Combine the two parts:
Some decimal fractions terminate in binary and some do not. Fractions whose denominators reduce to powers of 2 terminate cleanly. For example, \(0.5\), \(0.25\), \(0.125\), and \(0.0625\) terminate. Decimal 0.1 does not terminate in binary, so it becomes a repeating binary fraction. In practical calculators and programming languages, such values are displayed with a limited number of fractional bits.
Why Decimal 0.1 Is Not Simple in Binary
Decimal 0.1 is \(1/10\). Since \(10=2\times5\), the denominator includes a factor of 5 after reduction, and a pure base-2 fractional expansion cannot terminate. The binary representation repeats:
This is the reason many programming languages cannot represent decimal 0.1 exactly in ordinary binary floating-point format. The issue is not a mistake in binary conversion; it is a consequence of changing bases. A fraction that is simple in base 10 may be repeating in base 2, just as \(1/3\) is repeating in base 10.
For whole-number decimal-to-binary conversion, exactness is straightforward. For fractional conversion, always note whether the binary fraction terminates or has been rounded. In school work, show enough digits to match the required precision. In programming work, keep the difference between integer binary conversion and floating-point representation clear.
Decimal to Binary for Programming
Programmers use decimal-to-binary conversion when checking bit masks, permissions, register settings, flags, byte values, and low-level data formats. A decimal log value such as 240 may be easier to understand when written as \(11110000_2\), because the binary form shows exactly which bits are set.
Many programming languages allow binary literals with a prefix such as 0b. For example,
0b1010 represents decimal 10. The prefix is not part of the binary number; it simply tells
the language that the digits should be interpreted in base 2. This calculator shows the mathematical
binary digits, so decimal 10 returns 1010, not 0b1010.
If you are performing binary arithmetic after conversion, the binary calculator is better suited for addition, subtraction, multiplication, and division in base 2. This page is narrower: it converts decimal values into binary notation and explains the base conversion process.
Decimal to Binary in Digital Electronics
Digital electronics uses binary because logic circuits operate with two signal states. A switch can be open or closed. A transistor can be off or on. A voltage can be interpreted as low or high. These physical states map naturally to 0 and 1. Decimal-to-binary conversion helps connect human-readable values with the bit patterns used by circuits.
For example, an 8-bit input port may read decimal 13. Converting decimal 13 to binary gives \(00001101_2\) if written as a full byte. That bit pattern shows that the 8, 4, and 1 positions are set. If those positions correspond to switches or sensor flags, the binary form is more informative than the decimal form alone.
Students learning Boolean logic may also find RevisionTown's Boolean algebra guide useful after they understand basic binary notation. Binary conversion tells you how values are represented; Boolean algebra explains how digital logic combines and transforms 0s and 1s.
Decimal to Binary in Networking
Networking often uses decimal displays for values that are handled internally as binary. IPv4 addresses are a common example. Each dotted-decimal octet represents one 8-bit value. Decimal 192 is \(11000000_2\). Decimal 168 is \(10101000_2\). A subnet mask octet of 255 is \(11111111_2\), while an octet of 0 is \(00000000_2\).
Converting decimal octets to binary helps students understand subnet masks, network prefixes, and host ranges. For instance, decimal 255 in a subnet mask means all eight bits in that octet are network bits. Decimal 0 means none of the bits in that octet are network bits. Intermediate values such as 128, 192, 224, 240, 248, 252, and 254 show common prefix boundaries.
When converting network octets, preserve the 8-bit width. Decimal 5 is \(101_2\) as a number, but as an IPv4 octet it is usually written as \(00000101_2\). The value is the same; the leading zeros make the byte structure visible.
Decimal Numbers Versus Decimal Fractions
The word "decimal" can mean two related things. In number systems, decimal means base 10. In everyday arithmetic, a decimal can also mean a number with a decimal point, such as 12.625. This page uses "decimal to binary" mainly in the number-system sense: convert a base-10 value to base 2. The calculator can also illustrate fractional expansion, but most manual conversion questions focus on whole numbers.
If a problem says "convert 37 from decimal to binary," it usually means \(37_{10}\rightarrow100101_2\). If a problem says "convert the decimal fraction 0.625 to binary," it is asking for the repeated multiplication method on the fractional part. Read the wording carefully so you choose the correct process.
Decimal to Binary Versus Text to Binary
Numeric decimal-to-binary conversion is different from encoding text as binary. Decimal 65 converts to \(1000001_2\) as a number. In ASCII text, the character A is assigned decimal code 65, and the 8-bit binary form is \(01000001_2\). The number conversion and the text encoding are related, but they answer different questions.
If you want to turn words or characters into binary bytes, use a text-focused tool such as the ASCII text to binary converter. If you want to convert a base-10 number such as 65 into its base-2 numeric form, this decimal to binary calculator is the correct tool.
This distinction prevents a common misunderstanding. The binary string \(01000001_2\) can be interpreted as the number 65, or as the ASCII letter A if the context says it is text. The bits are the same, but the interpretation depends on the data type.
Decimal to Binary, Hexadecimal, and Octal
Binary is not the only base used in computing. Hexadecimal uses base 16, and octal uses base 8. Hexadecimal is compact because one hex digit represents exactly four binary bits. Octal is compact because one octal digit represents three binary bits. Decimal is convenient for human arithmetic, while binary shows the individual bits directly.
For example, decimal 42 can be written in several bases:
Use this page when the target base is binary. If the target base is hexadecimal, use the decimal to hex converter. If the target base is octal, use the decimal to octal converter. For mixed conversions across several bases, the hex, decimal, octal, binary converter gives a broader view.
Common Mistakes When Converting Decimal to Binary
A reliable way to catch errors is to convert the binary result back to decimal. If your work says \(25_{10}=1101_2\), the check fails because \(1101_2=13_{10}\), not 25. The correct result is \(11001_2\). This reverse check is quick and exposes most digit-order mistakes.
Negative Decimal Numbers and Signed Binary
For a simple mathematical conversion, a negative decimal number can be written with a negative sign in front of the binary magnitude. For example, \(-13_{10}=-1101_2\). That notation is understandable in mathematics, but it is not how fixed-width computer integers are usually stored.
Computers often use two's complement for signed integers. In an 8-bit two's complement system, \(-1\) is stored as \(11111111_2\), \(-2\) as \(11111110_2\), and \(-128\) as \(10000000_2\). The same bit pattern can therefore mean different things depending on whether it is interpreted as unsigned or signed.
This calculator focuses on base conversion rather than full signed-integer encoding. If a question asks for ordinary decimal-to-binary conversion, convert the magnitude and keep the sign. If a question asks for an 8-bit, 16-bit, or 32-bit two's complement representation, you must apply the fixed-width signed rule specified by the problem.
How to Check Decimal to Binary by Estimation
Before accepting an answer, check the size. If a decimal number is between \(2^n\) and \(2^{n+1}\), its binary form should have \(n+1\) bits. For example, 100 is between 64 and 128, so its binary form should have 7 bits. The answer \(1100100_2\) has 7 bits and is plausible.
If a decimal number is exactly a power of 2, the binary form should be a 1 followed by zeros. If a decimal number is one less than a power of 2, the binary form should be all 1s. These two patterns are especially useful for checking values such as 15, 16, 31, 32, 63, 64, 127, 128, 255, and 256.
Another check is parity. Even decimal numbers must end in binary 0 because they are divisible by 2. Odd decimal numbers must end in binary 1 because division by 2 leaves a remainder of 1. If your binary answer for 26 ends in 1, something went wrong; if your binary answer for 27 ends in 0, something went wrong.
Decimal to Binary in Spreadsheets and Code
When using spreadsheets, keep the original decimal value in one column and the binary output in another. Label the columns clearly as "decimal" and "binary" so the base is not lost. If fixed width matters, add a third column for bit width, such as 8-bit or 16-bit. This prevents leading zeros from being discarded accidentally.
In code, choose variable names that include the base or purpose. Names such as decimalValue
and binaryString are clearer than two variables named number. A binary value
with leading zeros is often best stored as a string, because numeric types may remove those zeros.
If you are studying the broader idea of number systems, RevisionTown's number systems guide explains how binary and hexadecimal relate. For a wider set of conversion tools, the base converter and binary converter can support related workflows.
Practice Questions
Try these conversions by hand before checking the answer. Use repeated division for the first few, then try powers-of-2 shortcuts for values near familiar bit boundaries.
| Decimal | Binary | Check |
|---|---|---|
| 6 | 110 | \(4+2=6\) |
| 9 | 1001 | \(8+1=9\) |
| 14 | 1110 | \(8+4+2=14\) |
| 19 | 10011 | \(16+2+1=19\) |
| 37 | 100101 | \(32+4+1=37\) |
| 42 | 101010 | \(32+8+2=42\) |
| 73 | 1001001 | \(64+8+1=73\) |
| 200 | 11001000 | \(128+64+8=200\) |
When to Use a Decimal to Binary Calculator
Use a calculator when the number is large, when you need to check a manual answer, or when the result will be used in code, a report, a lesson, or a digital electronics exercise. Manual conversion is still worth learning because it explains bit positions and place value. The calculator is most helpful after you understand the method and want speed or verification.
For classroom work, write at least one line showing the repeated division method or the powers-of-2 sum. For programming work, keep the decimal and binary forms together in comments or documentation when the bit pattern matters. For networking work, keep 8-bit groups visible. The correct binary digits are only part of the answer; the context tells readers how to interpret them.
Exam and Worksheet Layout for Decimal to Binary
When you need to show working, a clean layout matters almost as much as the arithmetic. Write the decimal number on the left, divide by 2 repeatedly, and keep the remainder in a separate column. Do not squeeze the quotient and remainder into one crowded line if the question is worth method marks. A clear table makes it obvious that you know which value is being divided and which value is being recorded as a binary digit.
| Convert \(45_{10}\) | Quotient | Remainder | Binary digit role |
|---|---|---|---|
| \(45\div2\) | 22 | 1 | Rightmost bit |
| \(22\div2\) | 11 | 0 | Next bit left |
| \(11\div2\) | 5 | 1 | Next bit left |
| \(5\div2\) | 2 | 1 | Next bit left |
| \(2\div2\) | 1 | 0 | Next bit left |
| \(1\div2\) | 0 | 1 | Leftmost bit |
Reading the remainder column upward gives \(101101_2\). A good final line is \(45_{10}=101101_2\). If the question asks for a fixed width, add leading zeros after the conversion, not during the division. For example, as an 8-bit value, decimal 45 is \(00101101_2\). The underlying value is still \(101101_2\), but the byte format shows all eight bit positions.
For exam answers, keep the base labels visible. A line such as \(45=101101\) may be accepted in some contexts, but \(45_{10}=101101_2\) is clearer and safer. The subscripts remove any ambiguity about whether the digits are being read in base 10 or base 2. They also show that the answer is a change of notation, not a change of quantity.
Subtraction Method for Decimal to Binary
The subtraction method is a useful alternative when you already know powers of 2. Start with the largest power of 2 that is less than or equal to the decimal number. Put a 1 in that position, subtract the power, and continue downward through the remaining powers. Put a 0 anywhere the power is too large for the remaining value.
Convert \(156_{10}\) using subtraction. The largest power of 2 less than or equal to 156 is 128, so the first bit is 1 and the remainder is 28. The next powers are 64 and 32, both too large, so their bits are 0. The next power is 16, so add a 1 and leave remainder 12. The next power is 8, so add a 1 and leave remainder 4. The next power is 4, so add a 1 and leave remainder 0. The 2 and 1 positions are then zeros.
The subtraction method is fast for values near familiar powers. It also explains the final bit pattern visually: each 1 marks a power of 2 that was used in the sum. The repeated division method is usually more mechanical and less dependent on memory, while the subtraction method is better for mental checks and for understanding why each bit is present.
Byte-Width Examples: 4-bit, 8-bit, and 16-bit Output
The same decimal value can be displayed with different bit widths. This is common in programming and digital electronics. The value does not change when leading zeros are added, but the width tells you how many positions are being stored or transmitted. Decimal 9 is \(1001_2\) as a minimal binary number. As an 8-bit byte, it is \(00001001_2\). As a 16-bit word, it is \(0000000000001001_2\).
Fixed-width output is important when every bit position has a meaning. In a register, bit 0 may control one option, bit 1 another option, and bit 7 another option. If you drop leading zeros, the value may still be numerically correct, but the visual layout can become harder to compare with a data sheet or table of bit positions.
| Decimal | Minimal binary | 8-bit binary | Why width matters |
|---|---|---|---|
| 5 | 101 | 00000101 | Shows bit 2 and bit 0 set in a byte |
| 13 | 1101 | 00001101 | Useful for byte flags and small masks |
| 64 | 1000000 | 01000000 | Shows the 64 place inside 8 bits |
| 128 | 10000000 | 10000000 | Highest bit of an unsigned byte |
| 200 | 11001000 | 11001000 | Already fills 8 bits |
If a value is too large for a chosen width, adding leading zeros will not solve the problem. Decimal 300 converts to \(100101100_2\), which needs 9 bits. It cannot be represented as an 8-bit unsigned value without overflow or a different interpretation. Always compare the decimal value with the maximum unsigned value for the width: \(2^n-1\).
Decimal to Binary for Bit Masks and Flags
A bit mask is a number used to select or describe individual bits. Decimal notation may be compact, but binary notation shows the actual pattern. Suppose a program reports a status mask of decimal 13. Convert 13 to binary and write it as an 8-bit value: \(00001101_2\). This shows that the 8, 4, and 1 positions are set while the 2 position is not set.
This is useful when a table says bit 0 means "enabled," bit 2 means "ready," and bit 3 means "error." Decimal 13 alone does not make those flags visible. The binary form \(00001101_2\) immediately shows which positions contain 1s. In that sense, decimal-to-binary conversion is not just a school exercise; it is a practical debugging tool.
For masks, preserve the width used by the system. An 8-bit mask, a 16-bit mask, and a 32-bit mask can display the same numeric value with different numbers of leading zeros. The leading zeros are part of the representation even though they do not affect the unsigned value. They make bit positions easier to count and compare.
Decimal to Binary for Color Values
Digital color channels are often stored as 8-bit values from 0 to 255. A red, green, or blue channel of decimal 0 is \(00000000_2\). A channel of decimal 255 is \(11111111_2\). A channel of decimal 128 is \(10000000_2\). Converting these decimal channel values to binary helps explain why 8-bit channels have 256 possible levels.
For example, decimal 200 converts to \(11001000_2\). As a color channel, that means the 128, 64, and 8 bit weights are active. Designers normally work with decimal or hexadecimal color notation, but binary reveals the underlying bit structure. This is helpful in computer science lessons, image-processing discussions, and low-level graphics programming.
Binary is usually not the most compact way to write colors, but it is the clearest way to see individual bits. Hexadecimal is compact because two hex digits represent one 8-bit channel. For example, \(200_{10}=11001000_2=C8_{16}\). All three forms describe the same channel value.
Precision Notes for Fractional Decimal Conversion
When converting decimal fractions to binary, decide how many fractional bits are needed before you round or stop. A value such as \(0.625_{10}\) terminates quickly as \(0.101_2\). A value such as \(0.1_{10}\) repeats, so there is no finite binary string that captures it exactly. If a calculator shows a limited binary expansion, it is showing an approximation.
In classroom work, the question may say "give the answer to 8 binary places" or "round to 4 bits after the binary point." In programming work, the limit may come from the data type, such as single-precision or double-precision floating point. In measurement work, the limit may come from the required tolerance. The unit conversion process is exact, but the displayed fractional result may be rounded.
A good written answer names the precision. For example, you might write \(0.1_{10}\approx0.00011001_2\) to 8 fractional bits. The approximation symbol matters because the binary expansion continues. For a terminating value, use equality instead: \(0.625_{10}=0.101_2\).
Choosing the Right Number-Base Tool
Use this page when the input is decimal and the required output is binary. Use a reverse converter when the input is already binary and the required output is decimal. Use a multi-base converter when you need to compare binary, decimal, octal, and hexadecimal at the same time. Choosing the direction first helps avoid entering the correct digits into the wrong tool.
For learning, the direct decimal-to-binary direction is especially useful because it teaches how base-10 values become bit patterns. Once that is comfortable, related conversions become easier. Decimal to hexadecimal relies on base 16 place value. Decimal to octal relies on base 8 place value. Binary to decimal relies on summing powers of 2. The shared idea is positional notation: each digit has a value because of its position and the base of the system.
If a task involves text, do not treat the text as a single decimal number unless the assignment specifically says to do so. Text-to-binary encoding maps characters to numeric codes and then writes those codes in binary. Numeric decimal-to-binary conversion simply rewrites a number in base 2. The difference is small in wording but important in output.
Before using a converted value in a final answer, copy the decimal input, the binary output, and the expected width into the same line of notes. A compact record such as \(37_{10}=100101_2\) or \(37_{10}=00100101_2\) as an 8-bit value makes later checking much easier. It also prevents a common documentation problem: the binary digits may be correct, but readers cannot tell whether leading zeros were intentionally omitted or accidentally lost during formatting.
About RevisionTown
RevisionTown provides calculators, converters, and study resources for mathematics, science, computing, and exam preparation. This decimal to binary converter is designed to give a direct result while also showing the reasoning needed for learning, checking, and explaining base-2 conversion.
Decimal to Binary FAQs
How do you convert decimal to binary?
Divide the decimal number by 2, record the remainder, and repeat with each new quotient until the quotient is 0. Then read the remainders from bottom to top. For example, \(13_{10}\) gives remainders 1, 0, 1, 1, so the binary answer is \(1101_2\).
What is 10 in binary?
\(10_{10}=1010_2\). The check is \(1\times8+0\times4+1\times2+0\times1=10\).
What is 25 in binary?
\(25_{10}=11001_2\). The powers-of-2 check is \(16+8+1=25\), so the 16, 8, and 1 positions are set to 1.
Why do you read remainders from bottom to top?
The first remainder is the least significant bit, which is the rightmost binary digit. Each later division finds the next bit to the left. Reading from bottom to top places the largest bit first and the smallest bit last.
What is the binary form of 255?
\(255_{10}=11111111_2\). It is \(2^8-1\), the largest unsigned value that can fit in 8 bits.
Do leading zeros change a binary number?
No. \(101_2\), \(0101_2\), and \(00000101_2\) all equal decimal 5 as unsigned numbers. Leading zeros are used when fixed width matters, such as an 8-bit byte.
Can decimal fractions be converted to binary?
Yes. Convert the whole-number part with repeated division by 2 and the fractional part with repeated multiplication by 2. Some decimal fractions terminate in binary, while others repeat and must be rounded to a chosen number of bits.
What is the difference between decimal to binary and binary to decimal?
Decimal to binary changes a base-10 number into base 2. Binary to decimal changes a base-2 number into base 10. They are reverse directions and use different classroom methods.
Is binary only used by computers?
Binary is most strongly associated with computers and digital electronics, but it is also a general mathematical number system. Any whole number can be written in binary, just as it can be written in decimal, octal, or hexadecimal.
How many bits are needed for a decimal number?
A positive integer \(N\) needs \(\lfloor\log_2 N\rfloor+1\) bits. For example, 100 needs 7 bits because it is between \(2^6=64\) and \(2^7=128\).






