Decimal to Binary Converter

Convert decimal numbers to binary with advanced options

Results


-
-

Conversion History


No conversion history yet.

How Binary Conversion Works


The Decimal Number System (Base 10)

The decimal number system uses 10 digits (0-9). Each position represents a power of 10:

Example: 423 = 4×10² + 2×10¹ + 3×10⁰ = 400 + 20 + 3

The Binary Number System (Base 2)

The binary number system uses only 2 digits (0 and 1). Each position represents a power of 2:

Example: 101 = 1×2² + 0×2¹ + 1×2⁰ = 4 + 0 + 1 = 5

Converting Decimal to Binary

Method 1: Division by 2

  1. Divide the decimal number by 2.
  2. Get the integer quotient for the next iteration.
  3. Get the remainder for the binary digit.
  4. Repeat until the quotient becomes 0.
  5. The binary digits are read from bottom to top.
Example: Convert 42 to binary
Division Quotient Remainder (Binary Digit)
42 ÷ 2210
21 ÷ 2101
10 ÷ 250
5 ÷ 221
2 ÷ 210
1 ÷ 201

Reading from bottom to top: 101010

Fractional Decimal to Binary

For numbers with fractional parts:

  1. Convert the integer part using the method above.
  2. For the fractional part, repeatedly multiply by 2.
  3. The integer part of the result is the binary digit.
  4. Continue with the fractional part of the result until precision is reached.
Negative Numbers (Two's Complement)

Two's complement is used to represent negative numbers in binary:

  1. Convert the absolute value to binary.
  2. Invert all bits (change 0 to 1 and 1 to 0).
  3. Add 1 to the result.