Convert base-10 decimal integers into base-2 binary instantly. Great for programming, computer science homework, and number-system practice.
Decimal InputDecimal → Binary
0 chars
Binary Output
0 chars
Try an example
How Decimal Becomes Binary
Binary is a positional base-2 notation. Each bit represents a power of two, so converting a non-negative decimal integer means finding which powers of two add up to the value.
For 42, the useful powers are 32 + 8 + 2. Marking those positions with 1 gives:
42 = 32 + 8 + 2 = 101010₂
Decimal
Binary
Useful boundary
8
1000
Power of two
42
101010
Worked example
127
1111111
Largest positive signed 8-bit value
128
10000000
Sets the high bit in one byte
255
11111111
All bits set in one byte
256
100000000
Requires 9 bits
Input Rules and Width
This converter accepts decimal digits for non-negative integers and uses exact integer arithmetic rather than floating-point math. It does not accept decimal fractions, a leading minus sign, or prefixes such as 0x.
The result uses the shortest binary representation, so decimal 5 becomes 101, not 00000101. If a protocol requires an 8-, 16-, or 32-bit field, pad with leading zeros only after you know the required width.