# Decimal to Octal Converter

## Converting Decimal to Octal

Decimal and Octal 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. Octal is written base 8, which gives 8 possible values per digit (0-7). Octal, while still less popular than decimal and hexadecimal number representations, are still used in computer applications. For example, Unix uses octal numbers to denote file permissions, as they are 12 bits wide.

The conversion between base 10 and base 8 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 octal using the above steps.

Division | Quotient | Remainder |
---|

2348 / 8 | 293 | 4 (4) |

293 / 8 | 36 | 5 (5) |

36 / 8 | 4 | 4 (4) |

4 / 8 | 0 | 4 (4) |

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

is `4454`_{8}

.