# Decimal to Octal Converter Online Tool

_{8}

_{16}

_{2}

## About Decimal to Octal Converter Online Tool:

This online decimal to octal converter tool helps you to convert one input decimal number (base 10) into a octal number (base 8).

## Decimal Numeral System:

Decimal numeral system (also called Hindu-Arabic, or Arabic) has 10 digits, include `(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)`

, it's the most used number system in our daily life. Decimal numeral system is also
one of the most ancient number system, it's inspired by 10 fingers of human.

## Octal Numeral System:

Octal numeral system (Oct) has 8 digits, include `(0, 1, 2, 3, 4, 5, 6, 7)`

. One Octal digit can be represented by 3 digits binary digits.

## How to convert from decimal to octal?

Step 1: Divide the decimal number by 8, get the integer quotient and the remainder.

Step 2: Convert the remainder to the octal digit in that position.

Step 3: Using the integer quotient to repeat the steps until the integer quotient equals to 0.

**Example: Convert decimal number "4321" to octal (result is "10341"):**

Repeat Division | Integer Quotient | Remainder (decimal) | Remainder (octal) | Digit Position |
---|---|---|---|---|

4321/8 | 540 | 1 | 1 | 0 |

540/8 | 67 | 4 | 4 | 1 |

67/8 | 8 | 3 | 3 | 2 |

8/8 | 1 | 0 | 0 | 3 |

1/8 | 0 | 1 | 1 | 4 |

## Decimal to Octal conversion table:

Decimal | Octal | Decimal | Octal |
---|---|---|---|

1 | 1 | 30 | 36 |

2 | 2 | 40 | 50 |

3 | 3 | 50 | 62 |

4 | 4 | 60 | 74 |

5 | 5 | 70 | 106 |

6 | 6 | 80 | 120 |

7 | 7 | 90 | 132 |

8 | 10 | 100 | 144 |

9 | 11 | 200 | 310 |

10 | 12 | 300 | 454 |

11 | 13 | 400 | 620 |

12 | 14 | 500 | 764 |

13 | 15 | 600 | 1130 |

14 | 16 | 700 | 1274 |

15 | 17 | 800 | 1440 |

16 | 20 | 900 | 1604 |

17 | 21 | 1000 | 1750 |

18 | 22 | 2000 | 3720 |

19 | 23 | 3000 | 5670 |

20 | 24 | 4000 | 7640 |

## More information:

Wikipedia (Octal): https://en.wikipedia.org/wiki/Octal

Wikipedia (Decimal): https://en.wikipedia.org/wiki/Decimal

## Convert Decimal to Octal with Python:

def decimal_to_octal(decimal_str): decimal_number = int(decimal_str, 10) octal_number = oct(decimal_number) return octal_number decimal_input = '4321' octal_output = decimal_to_octal(decimal_input) print('octal result is:{0}'.format(octal_output)) ------------------- octal result is:0o10341

## Convert Decimal to Octal with Java:

public class NumberConvertManager { public static String decimal_to_octal(String decimal_str) { return Integer.toOctalString(Integer.parseInt(decimal_str)); } public static void main(String[] args) { String decimal_input = "4321"; String octal_output = decimal_to_octal(decimal_input); System.out.println("octal result is:" + octal_output); } } ------------------- octal result is:10341