Binary Converter
The number 42 in binary is 101010 — six bits alternating all the way, which is one reason programmers are fond of it.
How it works
Flip between the counting system humans use and the one machines use. Decimal to binary shows the bit pattern with its length and the octal and hex readings alongside, because real work never involves one base at a time. Binary back to decimal validates that your input is genuinely binary before believing it.
Negative and fractional values are declined with an explanation rather than guessed at: two's-complement and floating-point are each their own conventions, and neither is the plain conversion this page promises.
The method
Standard base conversion on whole numbers: decimal → base 2 by repeated division (as performed exactly by the browser's radix conversion on integers), binary → decimal by positional sum after validating the input contains only 0 and 1.
Frequently asked questions
How do I read 101010 as a number?
Each position doubles: from the right — 0×1, 1×2, 0×4, 1×8, 0×16, 1×32 — summing the lit positions gives 2 + 8 + 32 = 42.
Why are octal and hex shown too?
Because they are binary in shorthand: each octal digit is exactly 3 bits and each hex digit exactly 4, so programmers read long bit patterns through them.
Can it convert negative numbers?
Not here. Negatives in binary are stored by convention (usually two's complement, which depends on a chosen bit width), so a width-free converter would be guessing.