# Decimal to Binary Converter

## Converting Decimal to Binary

Decimal and Binary are two ways to write numbers. In general, we use decimal numbers—also refered to as base 10—in our everyday lives. That means that there are 10 possible values (0-9) for each digit represented by a base 10 number. Binary is written base 2, which gives only 2 possible values per digit (0 or 1). Binary numbers are the language of computers, since they only understand two values fundamentally: a 1 or a 0. You can represent anything to a computer with just these two values, including numbers.

The conversion between base 10 and base 2 is not terribly complex. The process is the same for converting to any other base.

- Divide the original decimal number by the new base value.
- The remainder of the division operation is the value of the first digit of the converted number.
- Divide the quotient of the division operation by the base value.
- The remainder from Step 3 will be the next digit (to the left) of the base number.

### Example

The below is the representation of the conversion operation of `2348`_{10}

to binary using the above steps.

Division | Quotient | Remainder |
---|

2348 / 2 | 1174 | 0 (0) |

1174 / 2 | 587 | 0 (0) |

587 / 2 | 293 | 1 (1) |

293 / 2 | 146 | 1 (1) |

146 / 2 | 73 | 0 (0) |

73 / 2 | 36 | 1 (1) |

36 / 2 | 18 | 0 (0) |

18 / 2 | 9 | 0 (0) |

9 / 2 | 4 | 1 (1) |

4 / 2 | 2 | 0 (0) |

2 / 2 | 1 | 0 (0) |

1 / 2 | 0 | 1 (1) |

Thus, the binary value of `2348`_{10}

is `100100101100`_{2}

.