About the Decimal to Octal Converter
Converting decimal numbers to base 8 is a common exercise in number systems and still useful for Unix permissions. This decimal to octal converter divides repeatedly by 8 and shows each remainder, working exactly for numbers of any size: 493 becomes 755 in octal. Binary and hexadecimal equivalents are listed too.
The converter uses the repeated-division method you would use on paper: divide by 8, keep the remainder, divide the quotient again, and read the remainders backwards. Every division is listed in the working section so you can follow or check it. Examples: 8 in decimal is 10 in octal; 64 in decimal is 100 in octal; 493 in decimal is 755 in octal.
Decimal to octal conversion is a standard exercise in computer science courses and is useful when you need to write a permission mode or a value for a system that expects base 8. Because 8 is 2 to the power of 3, each octal digit corresponds to exactly three bits, which is why octal was popular on early computers with 12-, 24- and 36-bit words.
Other bases are covered by the number base converter, which converts between any bases from 2 to 36. For arithmetic in these bases, use the binary calculator or the hex calculator; to turn text into its binary character codes, use text to binary.
How to use the Decimal to Octal Converter
- Enter the decimal numberType or paste the number. Whole numbers of any length, positive or negative. Commas are ignored.
- Read the octal resultThe octal value appears instantly, along with the binary and hexadecimal equivalents.
- Follow the workingOpen the step-by-step section to see how the conversion was done, digit by digit or division by division.
- Copy or shareCopy all results with one click, or copy a link that reopens the converter with the same number.
Decimal to Octal Converter features
- Exact conversion of numbers of any length using BigInt arithmetic
- Step-by-step working for homework and exam practice
- Binary and Hexadecimal results shown alongside
- Negative numbers with 8- to 128-bit two's complement forms
- Optional digit grouping (4 bits, 2 hex digits or thousands) for easy reading
- Accepts prefixes such as 0x, 0b and 0o and ignores spaces and underscores
- Runs in your browser with nothing sent to a server
Common uses
- Checking computer science and digital electronics homework
- Reading values from datasheets, debuggers and log files
- Working out color codes, permissions and bit masks
- Converting values for programming and scripting
- Learning how positional number systems work
Decimal to octal in practice: working by hand, reading file modes from programs, going through binary and checking answers
Decimal to octal conversion is a standard exercise in computer science courses and a practical step when a program reports file permissions as ordinary numbers. This guide converts a year by hand, decodes a file mode reported in decimal, shows the shortcut through binary and offers ways to check answers and avoid typical slips.
A worked example: 2026 by hand
Dividing 2026 by 8 gives 253 remainder 2. Then 253 divided by 8 gives 31 remainder 5, 31 divided by 8 gives 3 remainder 7, and 3 divided by 8 gives 0 remainder 3. Reading the remainders from the last to the first gives 3752. Checking with place values, 3 × 512 + 7 × 64 + 5 × 8 + 2 = 2026, confirms the answer.
Reading file modes from programs
Programs that inspect files often return the mode as a decimal number. A value of 33188 converts to octal 100644. The leading 100 indicates a regular file, and the final three digits, 644, are the permissions: read and write for the owner, read for group and others. Without converting to octal, the decimal number is meaningless.
Through binary
Because each octal digit is three bits, converting to binary first and grouping in threes from the right gives octal directly. For 493, the binary is 111101101, grouped as 111 101 101, which gives 7, 5 and 5, so 755. This route is often quicker for numbers that are already familiar in binary.
Checking your answer
Convert the octal result back to decimal with place values, as shown above. If the result does not match, the most likely errors are a misread remainder or remainders read in the wrong order. Keeping the division steps neatly in a column makes these slips easy to find.
Where octal is still useful
Octal mainly survives in Unix permissions, umask values, some older file formats and aircraft transponder codes, which use 4,096 combinations of the digits 0 to 7, exactly 8 to the power 4. Recognising these contexts explains why a modern system would expect base 8 at all.
Writing octal in code
When writing an octal value in code, use the prefix the language expects: 0o in Python and modern JavaScript, a leading 0 in C. Writing the digits without a prefix produces a decimal number with the same digits and a completely different value, a mistake that is easy to make when copying permissions into scripts.
Large numbers
The converter handles numbers of any size exactly, but very long octal results are hard to read. Grouping digits in threes or fours with spaces when copying them into notes keeps them readable, as long as the spaces are removed before the value is used anywhere.
Classroom variety
Teachers can extend exercises by asking students to convert the same number into binary, octal and hex, then explain why octal and hex conversions from binary need no arithmetic. Seeing all three forms side by side makes the idea of bases as different groupings of the same bits concrete.
Common mistakes
- Reading remainders top to bottom.
- Forgetting the octal prefix when writing values in code.
- Mixing up decimal and octal permission values.
- Grouping bits from the left when going through binary.
Related tools
To convert back to decimal, use Octal to Decimal Converter. To see the binary step, try Decimal to Binary Converter, and to interpret permission values, Chmod Calculator.
Octal in spreadsheets
The DEC2OCT function in Excel and Google Sheets converts whole columns of decimal values to octal. It is useful when a report lists file modes as decimal numbers and you want to compare them against expected permissions such as 644 and 755.
Printing octal in code
In Python, oct(493) returns 0o755 and format(493, 'o') returns 755 without the prefix. In JavaScript, (493).toString(8) gives 755, and C's printf uses the %o format. Printing values in octal while debugging permission code avoids converting them by hand.
Permissions from checkboxes
Each permission digit is the sum of read 4, write 2 and execute 1. An owner who can read and write gets 6, a group that can only read gets 4. Building the three digits this way, rather than converting a large decimal number, is the quickest route to modes such as 640 and 750.
Why 8 and 9 never appear
Base 8 uses only the digits 0 to 7. Just as decimal rolls over from 9 to 10, octal rolls over from 7 to 10, so octal 10 equals decimal 8. Any value containing an 8 or a 9 cannot be octal, which is a quick check when reading unfamiliar data.
Checking work in exams
Under exam pressure, write the place values 512, 64, 8 and 1 above your octal answer and multiply back. If the total matches the original decimal number, the conversion is right. This check takes under a minute and catches the most common slips, such as a misread remainder.
Privacy
Conversions run in your browser. Nothing you enter is sent anywhere or stored.
Frequently asked questions
How do I convert decimal to octal by hand?
Divide the number by 8 and write down the remainder (0 to 7). Keep dividing the quotient by 8 until it reaches 0, then read the remainders from the last to the first. For 100: remainders 4, 4 and 1 give 144 in octal.
What is the largest number this converter can handle?
It accepts up to 400 digits, far beyond the 64-bit limit of 18446744073709551615 (2^64 − 1). The calculation uses arbitrary-precision integers, so even very long numbers convert exactly without rounding.
Can I convert negative numbers?
Yes. Put a minus sign in front and the result keeps the sign, for example -8 in decimal is -10 in octal. For binary work, the details section also shows the two's complement form that computers use to store negative integers.
Does it convert fractions or decimal points?
No. The converter works with whole numbers, which is what bases are used for in computing. Fractional values such as 0.1 often have infinitely repeating forms in binary, so they need a separate floating-point tool.
Why are the digits grouped?
Grouping makes long numbers easier to read and check: binary is split into blocks of 4 bits (one hex digit each), hex into pairs (one byte each) and decimal into thousands. Untick the grouping option to get one continuous string for copying into code.
Where is octal still used?
Mainly in Unix and Linux file permissions (chmod 644, 755), in some older computer documentation and in number literals in programming languages, where a leading 0o or 0 marks an octal value. Each octal digit stands for exactly three bits.