Decimal To Binary
Reverse Conversion
How This Converter Works
Converts a signed whole-number decimal input to its base-2 representation.
Formula or rule
Validate as an optional sign followed by decimal digits, parse as a JavaScript integer, then format that integer in base 2.
Example
- Input
- 42
- Calculation
- 42 = 32 + 8 + 2; the corresponding binary place values are 101010.
- Result
- 101010