Binary Calculator (Decimal ⇄ Binary)

Convert a decimal integer to binary and back.

Binary 101010
Bit length 6

Formula: Repeated division by 2

Step-by-step with your numbers:
1. Values used:
2. Decimal number = 42
3.
4. Binary = 101010
5. Bit length = 6
Did we solve your problem today?

Binary is the base-2 number system that computers use, with only the digits 0 and 1.

The math behind it

Convert by repeatedly dividing by 2 and reading the remainders from bottom to top. Each binary place is a power of 2.

Worked example

42 in binary is 101010.

FAQ

Why do computers use binary?

Because electronic switches have two stable states — on (1) and off (0).