Tool to convert to octal base (base 8) or from octal base. Octal base is mostly used in computer science. Numbers written in the octal system use numbers from 0 to 7.
Octal System (Base 8) - dCode
Tag(s) : Arithmetics
dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!
A suggestion ? a feedback ? a bug ? an idea ? Write to dCode!
The octal system is a mathematical writing of numbers in base 8, using the digits 0 to 7 to represent values.
To write a decimal number in base 8 (octal system):
Step 1: Divide the decimal number by 8
Step 2: note the quotient and the remainder
Step 3: Divide the quotient obtained by 8
Step 4: Repeat steps 2 and 3 until the quotient is 0
Step 5: Read the remainder obtained from the last to the first, the number obtained by concatenating these remainders is the notation of the number in base 8.
Example: 123 in base $ 10 $ (also denoted $ 123_{(10)} $) is worth 173 in base $ 8 $ (also denoted $ 173_{(8)} $), because 128/8 = 15 remains 3, 15/8 = 1 remains 7, 1/8 = 0 remains 1.
For complete explanations on how to convert from $ N_1 $ base to $ N_2 $ base, see the base-N conversion tool.
To convert an octal number to decimal, multiply each digit by $ 8^n $, where $ n $ is the position of the digit from the right, then add the results.
Example: $ 234_{(8)} $ becomes 156 in decimal $ 2 \times 8^2 + 3 \times 8^1 + 4 \times 8^0 = 156_{(10)} $
For complete explanations on how to convert from $ N_1 $ base to $ N_2 $ base, see the base-N conversion tool.
Example: 123 in base $ 8 $ (also noted $ 123_{(8)} $) is written 83 in base $ 10 $ (also noted $ 83_{(10)} $)
The octal numbers can not have a digit $ 8 $ or $ 9 $.
In computer science, it is usual to display an initial zero in front of an octal number to indicate that they are written in base-8.
Example: $ 12 $ in base $ 8 $ is sometimes written $ 012 $ to indicate that it is an octal number.
Any reference to the number eight is a clue.
The octal system is sometimes preferred in programming because it allows binary data to be represented more concisely, making certain values easier to read.
This is the case for network addresses, file permissions in Unix/Linux (777) or some memory addressing (7,77,777,7777).
dCode retains ownership of the "Octal System (Base 8)" source code. Any algorithm for the "Octal System (Base 8)" algorithm, applet or snippet or script (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, breaker, translator), or any "Octal System (Base 8)" functions (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) or any database download or API access for "Octal System (Base 8)" or any other element are not public (except explicit open source licence like Creative Commons). Same with the download for offline use on PC, mobile, tablet, iPhone or Android app.
Reminder: dCode is an educational and teaching resource, accessible online for free and for everyone.
The content of the page "Octal System (Base 8)" and its results may be freely copied and reused, including for commercial purposes, provided that dCode.fr is cited as the source.
Exporting the results is free and can be done simply by clicking on the export icons ⤓ (.csv or .txt format) or ⧉ (copy and paste).
To cite dCode.fr on another website, use the link:
In a scientific article or book, the recommended bibliographic citation is: Octal System (Base 8) on dCode.fr [online website], retrieved on 2025-04-15,