Decimal to Octal Converter

Convert a decimal number to octal and an octal number back to decimal.

Supports signed and fractional values in both base-10 and base-8.

Updated August 12, 2026
Frank Zhao - Creator
CreatorFrank Zhao
Loading calculator…

Introduction / overview

The Decimal to Octal Converter switches a number between base 10 and base 8. Type a decimal such as 65216521 and you immediately get its octal form 14571814571_8; flip the mode and the same tool reads an octal value such as 324183241_8 back into decimal 16971697.

One tool, two directions: “decimal to octal” is the default, and the “octal to decimal” mode runs the conversion the other way. Both output fields are read-only — the result always follows from whatever you type.

This is the tool to reach for when you are studying number systems, decoding an octal value from documentation, checking a permission code, or just want to confirm what a base-8 representation looks like. Conversions are exact, and the calculator handles negative and fractional values too — so you can convert 6521-6521 to 145718-14571_8 or 0.50.5 to 0.480.4_8 in the same way.

How to use / quick start

1

Keep “decimal to octal” selected

This is the default mode under Convert…, so you can usually skip this step.

2

Type the decimal number

For example, enter 65216521 into the (Decimal input)₁₀ field.

3

Read the octal result

The (Octal output)₈ field shows 1457114571 — the same value written in base 8. Each place now stands for a power of 8 rather than 10.

4

Convert the other way when needed

Choose octal to decimal, type an octal value such as 324183241_8, and the (Decimal output)₁₀ field returns 16971697.

Worked example — why 6521 becomes 14571

Divide by 8, keep the remainder, and repeat with the quotient. The remainders, read from last to first, are the octal digits:

6521÷8=8156521 \div 8 = 815 r \text{ r }11
815÷8=101815 \div 8 = 101 r \text{ r }77
101÷8=12101 \div 8 = 12 r \text{ r }55
12÷8=112 \div 8 = 1 r \text{ r }44
1÷8=01 \div 8 = 0 r \text{ r }11

Reading the remainders upward gives 14571814571_8. You never have to do this by hand — the calculator shows it instantly — but knowing the pattern makes it easy to sanity-check the result.

Calculation method

Decimal to octal — repeated division by 8

To convert a decimal value, divide it by 8 and record the remainder as the rightmost octal digit. Then divide the quotient by 8 again, and keep going until the quotient reaches zero. The remainders, collected in reverse order, are the octal digits:

di=Nmod8,NN8d_i = N \bmod 8,\qquad N \gets \left\lfloor \frac{N}{8} \right\rfloor

Because 8 is larger than 10, octal digits appear less often than decimal ones — every three decimal digits usually compress into fewer octal digits, which is part of why octal is handy for compact output.

Octal to decimal — positional expansion

Going back, each octal digit did_i sits at a position worth 8i8^i, starting from the right at i=0i = 0:

N10=i=0n1di8iN_{10} = \sum_{i=0}^{n-1} d_i \cdot 8^i

For 324183241_8, that works out to:

3×83+2×82+4×81+1×803 \times 8^3 + 2 \times 8^2 + 4 \times 8^1 + 1 \times 8^0==1536+128+32+11536 + 128 + 32 + 1==16971697

The two modes are exact mirrors of each other, so you can check either direction and get the same value back.

What about fractions?

The same idea extends past the decimal point. Multiply the fractional part by 8, take the whole part as the next octal digit, and repeat. For example, 0.50.5 becomes 0.480.4_8 because 0.5=480.5 = \frac{4}{8}.

Frequently asked questions

Why is an input like 18 rejected?

Because octal only has the digits 00 through 77. A number such as 1818 contains an 8, which does not exist in base 8, so the calculator flags it. The decimal 1818 is fine — it just converts to octal 2222.

Does it handle negative or fractional numbers?

Yes. Negative values keep their sign, so 6521-6521 becomes 145718-14571_8. Fractions convert too — 0.50.5 is 0.480.4_8, and 12.4812.4_8 reads back as 10.510.5.

How large a number can I convert?

The octal side accepts up to 16 digits, so the largest value is 77777777777777778=281,474,976,710,6557777777777777777_8 = 281,474,976,710,655. The decimal side accepts magnitudes below 999,999,999,999,999,999999,999,999,999,999,999. If you need hexadecimal or any base between 2 and 64, the integer base converter is a more general tool.

Limitations

This converter works with base 10 and base 8 only. The octal input accepts just the digits 00 to 77 and at most 16 digits, and the decimal input must be smaller than 999,999,999,999,999,999999,999,999,999,999,999 in magnitude. Integer conversions are exact. For fractional values that do not terminate in base 8 — such as 0.10.1, which repeats as 0.0631463146314631463180.06314631463146314631\ldots_8 — the result is shown to a practical number of digits rather than an endless string. For hexadecimal or other bases, use a dedicated base converter instead.

Decimal to Octal Converter - Convert Between Base-10 and Base-8