Convert any decimal number to binary with step-by-step division-by-2 working. Shows equivalent hex and octal. Supports negative numbers (two's complement), decimal fractions, bit-length selector (4/8/16/32-bit), and batch conversion.
Type any integer or decimal number. For negative numbers, enable the Signed toggle to see the two's complement binary representation. Use the bit-length selector to see the number padded to 4, 8, 16, or 32 bits — matching common computer data types.
The tool shows the repeated division-by-2 method: divide the number by 2, record the remainder (0 or 1), and repeat until the quotient is 0. Reading the remainders bottom to top gives the binary result. Each division step is shown in a clear table.
The binary output is shown formatted with optional grouping (every 4 bits for readability). Results are also shown in hex and octal. Batch mode converts a list of decimal numbers to binary in one operation.
The standard method is repeated division by 2. Divide the number by 2 and note the remainder (0 or 1). Divide the quotient by 2 and note the remainder again. Continue until the quotient is 0. The binary number is the remainders read from bottom to top. For example: 13 ÷ 2 = 6 r1, 6 ÷ 2 = 3 r0, 3 ÷ 2 = 1 r1, 1 ÷ 2 = 0 r1. Reading remainders bottom to top: 1101. This tool shows every division step.
These refer to the number of binary digits (bits) used to represent the number. 4-bit (nibble): 0 to 15. 8-bit (byte): 0 to 255 unsigned, -128 to 127 signed. 16-bit (word): 0 to 65,535 unsigned. 32-bit (double-word): 0 to 4,294,967,295 unsigned. When a number is converted to binary, it is padded with leading zeros to fill the specified bit length. This matches how numbers are stored in actual computer memory and registers.
Negative integers are represented in two's complement binary. To convert -N: first convert N to binary in the chosen bit length, then invert all bits (flip 0s and 1s), then add 1. For example, -10 in 8-bit: 10 = 00001010, invert = 11110101, add 1 = 11110110. The result 11110110 is the 8-bit two's complement of -10.
For the fractional part, repeatedly multiply by 2. Take the integer part (0 or 1) as the next binary digit, and repeat with the fractional remainder. For example: 0.625 × 2 = 1.25 → bit 1; 0.25 × 2 = 0.5 → bit 0; 0.5 × 2 = 1.0 → bit 1. Result: 0.101 binary = 0.625 decimal. Some fractions repeat infinitely in binary even when they are terminating in decimal.
The decimal fraction 0.1 cannot be represented exactly in binary, just as 1/3 cannot be represented exactly in decimal. In binary, 0.1 is a repeating pattern: 0.0001100110011... (infinitely repeating). This is why floating-point arithmetic on computers can produce small rounding errors — for example, 0.1 + 0.2 = 0.30000000000000004 in many programming languages. This is not a bug but an inherent property of representing decimal fractions in binary.
Unsigned binary treats all bits as representing a positive value. Signed binary (specifically two's complement) uses the most significant bit as a sign bit: 0 for positive, 1 for negative. An 8-bit unsigned number represents 0–255. An 8-bit signed number represents -128 to 127. The same binary pattern means different decimal values depending on whether it is interpreted as signed or unsigned — for example, 11111111 = 255 unsigned but = -1 signed (8-bit two's complement).