Computers store everything in binary, but humans find long strings of ones and zeros hard to read. The octal system — base 8 — was an early compromise: each octal digit represents exactly three binary bits, so it is far more compact than binary while remaining easy to convert by hand. This decimal to octal converter translates numbers in both directions instantly and shows every step of the conversion, so you can follow the math or check homework with confidence.

What Is the Octal Number System?
Octal is a base-8 positional number system that uses the digits 0 through 7. Just as each position in decimal represents a power of 10 (ones, tens, hundreds), each position in octal represents a power of 8. The octal number 234, for example, means 2×8² + 3×8¹ + 4×8⁰ = 128 + 24 + 4 = 156 in decimal.
Octal became popular in early computing because the word sizes of machines like the PDP-8 and IBM mainframes were multiples of three bits, making octal the natural shorthand. Programmers could read a 12-bit machine word as four octal digits at a glance. Although hexadecimal has largely replaced octal in modern programming, octal survives in important niches — most famously Unix file permissions, where a mode like 755 is three octal digits describing read, write, and execute rights for owner, group, and others.
How to Convert Decimal to Octal
The standard method is repeated division by 8:
Step 1: Divide by 8
Divide the decimal number by 8 and record the remainder.
Step 2: Repeat with the quotient
Take the quotient from step 1 and divide it by 8 again, recording the new remainder. Keep repeating until the quotient reaches 0.
Step 3: Read the remainders backwards
The octal result is the sequence of remainders read from the last division up to the first.
Example: convert 156 to octal. 156 ÷ 8 = 19 remainder 4. 19 ÷ 8 = 2 remainder 3. 2 ÷ 8 = 0 remainder 2. Reading the remainders bottom-up gives 234. So 156 in decimal equals 234 in octal.
How to Convert Octal to Decimal
Going the other direction uses positional expansion: multiply each octal digit by 8 raised to the power of its position (counting from 0 at the rightmost digit) and add the results.
Example: convert 234 from octal to decimal. The digits are 2, 3, 4 with positions 2, 1, 0. Compute 2×8² = 128, 3×8¹ = 24, 4×8⁰ = 4. Sum: 128 + 24 + 4 = 156. The converter above shows each of these place-value multiplications so you can verify the arithmetic line by line.
How to Use This Converter
Type a decimal whole number in the first box and press “Convert to Octal” to get its base-8 equivalent with full division steps. To go the other way, type an octal number (digits 0–7 only) in the second box and press “Convert to Decimal” to see the positional expansion. Invalid input — letters, decimal points, or the digits 8 and 9 in an octal entry — triggers a clear error message explaining what went wrong.
Where Octal Is Used Today
Unix and Linux File Permissions
The chmod command uses octal: 755 grants the owner full rights and everyone else read-plus-execute, while 644 is the standard for regular files. Every system administrator reads octal fluently.
Embedded Systems and Legacy Code
Some microcontrollers, aviation systems, and older protocols still specify values in octal. Debugging tools for these platforms often display registers in base 8.
Programming Languages
C, C++, Java, and Python accept octal literals with a leading zero (0755) or a 0o prefix (0o755). Misreading these as decimal is a classic source of bugs, which is why a converter comes in handy.
Octal vs. Binary vs. Hexadecimal
All three are just shorthand for binary. One octal digit always maps to exactly three bits (e.g., 7 = 111), while one hexadecimal digit maps to four bits (F = 1111). Octal is slightly more compact to convert mentally in groups of three, but hexadecimal won the mainstream because modern byte-oriented machines work in multiples of four bits. For quick reference: binary 101110₂ = octal 56₈ = hexadecimal 2E₁₆ = decimal 46. Each system has the same value; only the representation changes.
Quick Decimal to Octal Reference Table
For the values that come up most often, skip the calculation and read the answer directly:
| Decimal | Octal | Decimal | Octal | Decimal | Octal | Decimal | Octal |
|---|---|---|---|---|---|---|---|
| 0 | 0 | 1 | 1 | 2 | 2 | 3 | 3 |
| 4 | 4 | 5 | 5 | 6 | 6 | 7 | 7 |
| 8 | 10 | 9 | 11 | 10 | 12 | 11 | 13 |
| 12 | 14 | 13 | 15 | 14 | 16 | 15 | 17 |
| 20 | 24 | 32 | 40 | 64 | 100 | 100 | 144 |
| 156 | 234 | 255 | 377 | 512 | 1000 | 1000 | 1750 |
Notice the pattern at powers of eight: 8 is 10 in octal, 64 is 100, and 512 is 1000 — exactly like powers of ten in the decimal system.
Decimal to Octal in Code and Spreadsheets
Every major programming language and spreadsheet can do this conversion natively:
- Python:
oct(156)returns the string ‘0o234’; the reverse isint('234', 8), which gives 156. - JavaScript:
(156).toString(8)returns “234”, andparseInt('234', 8)returns 156. - Java:
Integer.toOctalString(156)returns “234”. - C / C++: print with the %o format specifier, as in
printf("%o", 156). - Excel and Google Sheets:
=DEC2OCT(199)returns 307, and=OCT2DEC(234)returns 156.
Decimal fractions convert by repeated multiplication by 8 instead of division: multiply the fraction by 8, record the whole-number part, and repeat with the new fraction. For 0.75: 0.75 × 8 = 6.0, so 0.75 in decimal is 0.6 in octal. When reading any converted result, the first remainder (or product digit) you compute is the least significant digit — the final one you compute is the most significant, which is why the division method reads remainders bottom-up.
Practice Problems With Solutions
Test your understanding with these worked problems, then check your answers with the converter above.
Problem 1: Convert 73 to octal
73 ÷ 8 = 9 remainder 1. 9 ÷ 8 = 1 remainder 1. 1 ÷ 8 = 0 remainder 1. Reading remainders bottom-up: 111. So 73 in decimal equals 111 in octal. You can verify: 1×64 + 1×8 + 1×1 = 73.
Problem 2: Convert 777 from octal to decimal
7×64 + 7×8 + 7×1 = 448 + 56 + 7 = 511. Notice that 777 in octal is one less than 1000 octal, which equals 512 decimal — a useful pattern: repeating 7s always sit just below the next power of 8.
Problem 3: Convert 1000 to octal
1000 ÷ 8 = 125 remainder 0. 125 ÷ 8 = 15 remainder 5. 15 ÷ 8 = 1 remainder 7. 1 ÷ 8 = 0 remainder 1. Remainders bottom-up: 1750. Check: 1×512 + 7×64 + 5×8 + 0 = 512 + 448 + 40 = 1000.
Problem 4: What decimal number is 0o755?
This is the classic Unix permission value. 7×64 + 5×8 + 5×1 = 448 + 40 + 5 = 493. When you see 755 in a chmod command, the system is really working with the value 493.
Common Mistakes to Avoid
The most frequent error is including the digits 8 or 9 in an octal number — they do not exist in base 8, and the converter will reject them. Another is reading remainders top-to-bottom instead of bottom-to-top when converting by hand. Finally, remember that a leading zero in many programming languages signals octal, so the literal 010 means eight, not ten.
Frequently Asked Questions
How do you convert decimal to octal?
Divide the decimal number by 8 repeatedly, recording each remainder, until the quotient is 0. Then read the remainders from bottom to top. For example, 156 becomes 234 in octal.
What is 8 in octal?
Decimal 8 equals 10 in octal, because 8 is exactly one group of eight. Similarly, decimal 16 is 20 in octal and decimal 64 is 100 in octal.
Why does octal only use digits 0 to 7?
In any base-n system, the digits run from 0 to n−1. Since octal is base 8, its digits are 0 through 7. The digit 8 would mean one complete group of eight, which is written as 10 in octal.
How do you convert octal back to decimal?
Multiply each octal digit by 8 raised to its position index (starting at 0 from the right) and add the results. For 234 octal: 2×64 + 3×8 + 4×1 = 156.
Where is octal still used?
Unix/Linux file permissions (chmod 755), some embedded systems, aviation transponder codes, and octal literals in programming languages like C and Python (0o755).
What is the largest digit allowed in octal input?
The digit 7. Any input containing 8, 9, letters, or decimal points is not a valid octal number and will be rejected by the converter.
How do I convert decimal to octal in Excel or Google Sheets?
Use the DEC2OCT function: =DEC2OCT(199) returns 307. The reverse function is OCT2DEC, so =OCT2DEC(234) returns 156. Both functions accept an optional second argument that pads the result with leading zeros to a fixed number of characters.
How do I convert decimal to octal in Python or JavaScript?
In Python, oct(156) returns ‘0o234’; in JavaScript, (156).toString(8) returns “234”. To convert back, Python uses int(‘234’, 8) and JavaScript uses parseInt(‘234’, 8), both giving 156. The converter above is handy when you want the step-by-step division shown as well.