Decimal to Binary
Convert a decimal (base 10) integer to its binary (base 2) representation. Enter a whole number; we use the standard algorithm (repeated division by 2, remainders give bits from least to most significant). Negative numbers are represented in two’s complement form for a 32-bit word.
Convert to binary
Enter a decimal number to convert.
How it works
Repeatedly divide the number by 2 and take the remainder (0 or 1) as the next bit, from least significant to most. Read the remainders in reverse to get the binary string. Example: 42 ÷ 2 = 21 r 0, 21 ÷ 2 = 10 r 1, … → 101010.
When to use it
Use it when learning number bases, debugging bitwise operations, or preparing values for low-level programming or digital logic.
Frequently asked questions
- What about negative numbers? We show the 32-bit two’s complement representation (JavaScript >>> 0).
- Maximum value? We support 32-bit unsigned range (0 to 4,294,967,295) and signed negative equivalents.