Octal to Decimal Converter
Going the other way? Convert decimal back to octal →
How do you convert octal to decimal?
Octal to decimal conversion gives each digit the weight of its position, multiplies the digit by that weight, and adds the products together.
- Number the positions from the right, starting at 0.
- Give each position the weight 8ⁿ, so the rightmost digit is worth 1.
- Multiply every digit by its weight and add the products.
- The total is the decimal value: 234 = 156.
Octal to Decimal Conversion Table
One hexadecimal digit equals exactly 4 bits (16 = 2⁴); one octal digit equals exactly 3 bits (8 = 2³). Hex and octal are therefore converted by grouping bits, and hex ↔ octal passes through binary. That is the whole method, so the table below is the only thing you need: every group of 3 bits has exactly one octal digit, and the mapping never changes. Binary writes values on the digit set 0, 1 with each place worth 2ⁿ, and a value marked 0b is binary; octal values are marked 0o.
| 3 bits | Octal | Decimal |
|---|---|---|
| 000 | 0 | 0 |
| 001 | 1 | 1 |
| 010 | 2 | 2 |
| 011 | 3 | 3 |
| 100 | 4 | 4 |
| 101 | 5 | 5 |
| 110 | 6 | 6 |
| 111 | 7 | 7 |
Each base is defined by three things: which digits it uses, how a value is marked, and what each position is worth.
| Base | Radix | Digits | Prefix | Place worth | Typical range |
|---|---|---|---|---|---|
| Octal | 8 | 0–7 | 0o | 8ⁿ | 3 digits cover a byte (000–377); Unix permissions 000–777 |
| Decimal | 10 | 0–9 | none | 10ⁿ | any; decimal pages treat 0–255 as the byte range |
Worked Example: 234 to Decimal
One value, converted the long way so the working is visible. This is the same grid the converter shows when you turn on "show steps".
Result: 234 = 156
Number the positions from the right, starting at 0. Each position is worth 8 raised to that number, so the rightmost digit is worth 1, the next 8, the next 64, and so on up the value.
That turns 234 into 2 x 8^2 + 3 x 8^1 + 4 x 8^0, which adds up to 156. Digits that are 0 contribute nothing and can be skipped, but the position still counts — dropping a zero shifts every digit to its left and changes the value. This is the same expansion decimal itself uses; only the base in the weights differs.
Check it in reverse
The value returns unchanged. Convert 156 back and you get 234, because a base change rewrites the digits without touching the quantity they stand for. That is the whole test: if the round trip differs, a digit was misread. To check it by hand, convert the octal result back to decimal and compare it with the number you started from.
Worked examples: octal to decimal
Each example gives the value first, then the working. Click a value to load it in the converter.
What is 0o777 in decimal?
0o777 in octal is 511 in decimal.
Method: multiply each digit by its place value and add the products.
What is 0o234 in decimal?
0o234 in octal is 156 in decimal.
Method: multiply each digit by its place value and add the products.
What is 0o472 in decimal?
0o472 in octal is 314 in decimal.
Method: multiply each digit by its place value and add the products.
What is 0o12 in decimal?
0o12 in octal is 10 in decimal.
Method: multiply each digit by its place value and add the products.
What is 0o144 in decimal?
0o144 in octal is 100 in decimal.
Method: multiply each digit by its place value and add the products.
What is 0o377 in decimal?
0o377 in octal is 255 in decimal.
Method: multiply each digit by its place value and add the products.
What is 0o10 in decimal?
0o10 in octal is 8 in decimal.
Method: multiply each digit by its place value and add the products.
What is 0o20 in decimal?
0o20 in octal is 16 in decimal.
Method: multiply each digit by its place value and add the products.
What is 0o40 in decimal?
0o40 in octal is 32 in decimal.
Method: multiply each digit by its place value and add the products.
What is 0o100 in decimal?
0o100 in octal is 64 in decimal.
Method: multiply each digit by its place value and add the products.
What is 0o200 in decimal?
0o200 in octal is 128 in decimal.
Method: multiply each digit by its place value and add the products.
What is 0o14 in decimal?
0o14 in octal is 12 in decimal.
Method: multiply each digit by its place value and add the products.
Every example above reverses exactly — divide the same value down to octal digits.
What About Padding, Fractions and Width?
Leading zeros and width
A number carries no leading zeros unless a width is fixed. 156 and 0156 are the same value, so the converter writes the short form. Fixed widths belong to bytes and registers, not to arithmetic. the two universal conversion methods covers where width does matter.
Fractions and the point
Digits after a point convert by the same rule with negative powers, so the first place after the point is worth 1/10. Many fractions that end neatly in decimal repeat forever in binary, which is where rounding creeps in.
Negative values
A minus sign is kept in front of the digits. Fixed-width binary encodes sign differently, using two's complement, and that is a separate rule from the base change itself.
How large a value can be
The method has no ceiling; each extra octal digit multiplies the range by 8. Practical limits come from the width a machine stores the value in, not from the conversion.
Octal to Decimal in Code
The same rule in one line. Both read the digits and return the decimal total.
Python: int('234', 8) JavaScript: parseInt('234', 8) Common Mistakes
- Reading the remainders top to bottom. They come out in reverse, so the digits land backwards.
- Using a digit the base does not have — an 8 in octal, or a 2 in binary. The value cannot be read at all.
- Grouping bits from the left. Groups are counted from the right, and the leftmost group is the one that gets padded.
- Treating the result as a character code. 101 is a number here, not the letter A.
Frequently Asked Questions
Does a leading zero (017) mean octal?
In C and Python 2, yes: 017 is octal, worth 15 in decimal. Python 3 rejects the bare leading zero. 0b marks binary, 0o octal, 0x hexadecimal; a leading # marks a hex colour. Hexadecimal is not case-sensitive (FF = ff); iToolHub writes hex digits in uppercase.
Why does Linux use octal for file permissions?
Because each permission group is exactly 3 bits, and one octal digit, 0–7, is worth exactly 3 bits. Read, write and execute pack into one digit per group, so 755 is 111 101 101 in binary and 493 in decimal.
How do you convert octal to decimal in Python?
Read the digits with base 8: int('234', 8) returns 156. The literal 0o234 is the same number, and the one-liner under Octal to Decimal in Code uses the first form.
Nothing is lost in the expansion, so the same value converts straight back in the decimal to octal direction.
Related Conversions
The rest of the family sits on all the number and text converters in one place.