Base-10 to base-2

Decimal to Binary Converter

Enter a whole decimal number and convert it to binary with a readable remainder-by-remainder breakdown.

Binary-
Hex-
Bits-

Step-by-step conversion

Enter a decimal number to see the division-by-two steps.

Decimal to binary method

Decimal is base-10, while binary is base-2. To convert a decimal number to binary, repeatedly divide the number by 2 and record the remainder from each division. When the quotient reaches zero, read the remainders in reverse order to get the binary value.

For example, decimal 42 produces the remainders that form 101010. The same value can also be checked from the other direction by adding active powers of two: 32 + 8 + 2 = 42.

DecimalBinaryHex
111
2102
101010A
161000010
421010102A
25511111111FF

Why the remainders are read upward

Each division by two separates the current value into a quotient and a remainder. The first remainder is the rightmost binary digit because it tells you whether the original number is odd. The next remainder is the next power-of-two place, and the process continues until the quotient reaches zero. Reading the remainders from the last division back to the first produces the binary number in the correct left-to-right order.

For decimal 42, the active powers are 32, 8, and 2, so the result is 101010. The calculator shows the repeated divisions so you can compare the mechanical method with the place-value method. Both methods describe the same conversion and should produce the same result.

Common decimal to binary uses

This converter is useful for learning base 2, checking bit masks, preparing programming examples, and translating small decimal values from documentation. It accepts non-negative whole numbers. If you need to represent a negative value, use the signed format required by your system, such as a fixed-width two's-complement integer, rather than adding a minus sign to an unsigned binary answer.

For a value that represents a character, use the Text to Binary Converter instead. The number 42 and the text characters 4 and 2 are different inputs even though they look related. The ASCII table can help you inspect the character codes.

Related converters