Octal Number System Converter
Convert between octal, binary, decimal and hexadecimal instantly and see how the conversions work step by step.
Interactive Octal Converter
Digits allowed: 0–7. You can also enter a sign and decimal point.
Options
Step-by-step explanation
Enter a value in any field to see the conversion steps here.
What is the octal number system?
The octal number system is a positional numeral
system with base 8. It uses exactly eight
digits: 0, 1, 2, 3, 4, 5, 6, 7. Each position
represents a power of 8, just as each position in decimal
represents a power of 10.
For an octal number like \( (a_n a_{n-1} \dots a_1 a_0)_8 \), its decimal value is
Place values in octal
From right to left, the place values are:
- \(8^0 = 1\)
- \(8^1 = 8\)
- \(8^2 = 64\)
- \(8^3 = 512\)
- \(8^4 = 4096\)
So the octal number \(157_8\) means:
How to convert octal to decimal
- Write down the octal digits and their positions (starting from 0 on the right).
- Multiply each digit by \(8^{\text{position}}\).
- Add all the products.
Example: \( 345_8 \) to decimal
How to convert decimal to octal
Use repeated division by 8 and track the remainders.
- Divide the decimal number by 8.
- Record the remainder (0–7).
- Use the quotient as the new number and repeat until the quotient is 0.
- The octal digits are the remainders read from last to first.
Example: \( 229_{10} \) to octal
229 ÷ 8 = 28 remainder 5 → least significant digit
28 ÷ 8 = 3 remainder 4
3 ÷ 8 = 0 remainder 3 → most significant digit
Read remainders from bottom to top: 3 4 5 → 345₈
Octal and binary: a perfect match
Octal is especially convenient in computing because each octal digit corresponds exactly to three binary bits:
| Octal | Binary (3 bits) |
|---|---|
| 0 | 000 |
| 1 | 001 |
| 2 | 010 |
| 3 | 011 |
| 4 | 100 |
| 5 | 101 |
| 6 | 110 |
| 7 | 111 |
Octal → binary
- Replace each octal digit with its 3-bit binary equivalent.
- Optionally remove leading zeros.
Example: \( 57_8 \)
Binary → octal
- Group the binary digits into sets of 3 from right to left (pad with leading zeros if needed).
- Convert each 3-bit group to its octal digit.
Example: \( 101111_2 \)
Group: 101 111
101₂ = 5₈, 111₂ = 7₈ → 57₈
Octal and hexadecimal
Both octal (base 8) and hexadecimal (base 16) are used to represent binary data more compactly:
- 1 octal digit ↔ 3 binary bits
- 1 hex digit ↔ 4 binary bits
To convert between octal and hex, it is usually easiest to go through binary: octal → binary → hex or hex → binary → octal. The converter above does this for you automatically.
Where is octal used?
- Historical computers with word sizes that are multiples of 3 bits (12, 24, 36 bits).
-
Unix and Linux file permissions (e.g.
755,644are octal codes). - Digital electronics and low-level programming in some legacy systems.
Common questions about octal
Is 8 a valid octal digit?
No. Valid octal digits are only 0–7. If you see 8 or 9, the number is not a valid octal number.
How do I check if a number is octal?
A string is a valid octal literal if it contains only the
characters
0–7, optionally with a leading sign (+
or -) and a single decimal point if you allow
fractions. The calculator validates this for you and highlights
invalid input.
FAQ
What is an octal number?
An octal number is a number written in base 8 using only the digits 0–7. Each position represents a power of 8 instead of a power of 10 as in the decimal system.
How do you convert octal to decimal?
Multiply each digit by 8 raised to the power of its position index (starting from 0 on the right) and add the results. For example, 157₈ = 1×8² + 5×8¹ + 7×8⁰ = 111₁₀. The step-by-step box above shows this automatically for any value you enter.
Can this tool convert from decimal, binary or hex back to octal?
Yes. The converter is fully bidirectional. You can type into any of the four fields (octal, decimal, binary, hexadecimal) and all the others will update instantly, including the step-by-step explanation.
Does the converter support negative numbers and fractions?
Yes. You can enter a leading minus sign and a decimal point
in any base. The
Fraction precision
option controls how many digits
are used after the point when converting between bases.