Decimal to Octal

Convert decimal to octal as you type, with every step shown. This free online converter gives exact results for numbers of any size, and nothing you type leaves your browser.

1 Enter your value

From
To

Examples

2 Your answer

Decimal

419dec

Show in other bases

Tap any value to copy it.

See the working

Guide

How it works

Three steps, whether you are reading a memory address, a bit flag or a byte value.

  1. 1

    Choose what to convert

    Pick what you have and what you want: decimal, hexadecimal, binary or octal.

  2. 2

    Type or paste a value

    Write it however you like: 65,535, 0xFF, FFh, with commas, spaces or underscores.

  3. 3

    Read the answer

    It appears as you type, in every other base, with the working shown.

The formulas

A digit's value depends on its position. Every answer here uses one of these rules:

Decimal to octal

divide by 8, keep the remainders

419 ÷ 8 = 52 r 3, 52 ÷ 8 = 6 r 4, 6 ÷ 8 = 0 r 6, so 419 is 0o643.

Octal to decimal

decimal = Σ digit × 8position

0o643 is 6 × 64 + 4 × 8 + 3 × 1 = 419, so the answer checks out.

Octal to binary

each octal digit = 3 binary bits

0o643 is 6 → 110, 4 → 100, 3 → 011, so 0o643 is 110 100 011.

Decimal to hexadecimal digit chart

The decimal values 0 to 15 are the single hexadecimal digits 0 to F. Click one to add it to the converter.

All conversions

Decimal, hexadecimal, binary and octal converter

One free tool for every direction. Use it as a decimal to hexadecimal converter, convert decimal to binary or octal, or work backwards as a hexadecimal to decimal converter that turns 0x to decimal values. It also converts hexadecimal to binary, binary to hexadecimal and octal to decimal, so it works as a full number base converter and hexadecimal calculator. Pick a conversion to start.

Method

How to convert decimal to octal

To convert decimal to octal, divide the number by 8 and write down the remainder. Then divide the quotient by 8 again, and keep going until the quotient reaches 0.

Read the remainders from bottom to top to get the octal number.

Worked example

419 ÷ 8 = 52  remainder 3
52 ÷ 8 = 6  remainder 4
6 ÷ 8 = 0  remainder 6
Read bottom to top: 419 = 0o643

Decimal to Octal conversion table

Use this decimal to octal table as a quick decimal to octal chart for common values, from 0 to 65,535.

DecimalOctal
00
11
22
33
44
55
66
77
810
911
1012
1113
1214
1315
1416
1517
1620
3240
64100
100144
127177
128200
255377
256400
5121000
1,0001750
1,0242000
4,09610000
65,535177777

Help

Questions

Quick answers to what people most often ask about hexadecimal, decimal and binary.

01How do I convert decimal to octal?

To convert decimal to octal, divide the number by 8 and write down the remainder. Then divide the quotient by 8 again, and keep going until the quotient reaches 0. Read the remainders from bottom to top to get the octal number.

02What is 255 in octal?

255 in decimal is 0o377 in octal. Type 255 into the converter above to see every step.

03What is 1024 in octal?

1,024 in decimal is 0o2000 in octal.

04What is 10 in octal?

10 in decimal is 0o12 in octal.

05What is 16 in octal?

16 in decimal is 0o20 in octal. That is why 0x10 means sixteen, not ten.

06What is 100 in octal?

100 in decimal is 0o144 in octal.

07Where is octal still used?

Mostly in Unix and Linux file permissions, such as chmod 755, where each octal digit sets the read, write and execute bits for one group of users. It also appears in some older systems and programming languages, often written with a 0o prefix.

08How do I convert decimal to octal in Excel?

Use the DEC2OCT function: =DEC2OCT(255) returns 377. It works the same way in Google Sheets. These functions only handle up to 10 result characters, and the binary ones only −512 to 511, so use this converter for larger numbers.

09How do I convert decimal to octal in Python or JavaScript?

In Python, oct(255) returns '0o377'. In JavaScript, (255).toString(8) returns '377'. Python handles any size; in JavaScript use BigInt for numbers above 2⁵³.

10Does the converter use two’s complement for negative numbers?

No. It keeps the minus sign, so −255 is −0xFF, −0b11111111 and −0o377. Computers usually store negative numbers in two’s complement, where the pattern depends on the width: −1 is 1111 1111 (0xFF) in 8 bits and 0xFFFF in 16 bits. To read a signed value whose top bit is set, subtract 2ⁿ: 0xFF as a signed 8-bit number is 255 − 256 = −1.

11Can I convert decimal numbers with a decimal point?

The converter works with whole numbers. By hand, convert the fractional part by multiplying it by the target base again and again and keeping the whole-number part each time. For example, 0.5 × 16 = 8, so 0.5 is 0x0.8 in hexadecimal, 0b0.1 in binary and 0o0.4 in octal.

12Can I convert negative decimal numbers to octal?

Yes. Type a minus sign and the converter keeps it: −255 becomes −0o377. Numbers of any size work, because the converter uses exact whole-number arithmetic.

13What does “dec to oct” mean?

“dec to oct” is short for decimal to octal, which means going from base 10 to base 8: a number written in base 10 is rewritten in base 8. For example, 255 becomes 0o377.

14Does this decimal to octal calculator show the working?

Yes. It converts decimal to octal with steps: open “See the working” under the answer to see each division by 8 and the remainder it leaves. Every answer is also shown in decimal, hexadecimal, binary and octal at once.

15Is this decimal to octal converter free?

Yes. It is free with no sign-up, works online on phones, tablets and computers, and every decimal to octal conversion runs in your browser, so nothing you type is sent anywhere.