do

Decimal to Octal

βœ“ Free & no signup πŸ”’ Runs 100% in your browser Updated 2026-11-25 Binary Converter Tools

Every decimal number has an octal twin, and this page shows you the twin live as you type. Enter 100 and the tool returns 144; enter 511 and it returns 777. The conversion treats your input as one whole integer of any size, computing the exact base-8 representation with arbitrary-precision arithmetic inside your browser. Nothing is uploaded, the tool is free with no signup, and the same page works on a phone during a lecture as on a workstation mid-script.

Decimal-to-octal conversion is one of the classic teaching exercises because it cannot be done by substitution. There is no clean digit mapping between base 10 and base 8 the way there is between base 8 and base 2, so the conversion actually requires division, which makes it the standard example for teaching positional notation in reverse. Once you can hop between bases 10 and 8, jumping to binary or hex feels easy because those convert by regrouping.

Octal matters less today than hexadecimal, but it owns one enduring niche: Unix file permissions. When a script needs to verify that a directory is mode 755, or a config file stores an integer that turns out to be a permission pattern, converting decimal to octal is the move that makes the number legible again.

What Base 8 Notation Means

Octal writes numbers using eight digits, 0 through 7, with positions weighted by powers of 8: ones, eights, sixty-fours, five-hundred-twelves, and upward. The octal number 144 means 1 times 64 plus 4 times 8 plus 4, which is 64 plus 32 plus 4, exactly 100 in decimal. Each position is worth eight times the one to its right, which is why octal numbers need more digits than decimal for the same value: 255 decimal, which fits in three decimal digits, is 377 in octal, also three digits, but 4096 decimal needs 10000 octal, five digits.

Because 8 is 2 to the third power, each octal digit corresponds to exactly three bits. That relationship is why 511 becomes 777: 511 in binary is 11111111, which groups into 011 111 111, reading as 777. This is also why permission digits never exceed 7, and why seeing an 8 or 9 in what claims to be an octal number is always an error.

How to Use This Tool (Step by Step)

  1. Type your decimal integer into the input box. Negative signs and decimal fractions are not part of this converter; it handles non-negative whole numbers of any length.
  2. The octal result updates live with every keystroke, so you can watch digits change as you edit.
  3. If the input contains anything other than decimal digits, an error message names the invalid character rather than guessing.
  4. Click copy to move the result into your code, terminal, or worksheet.
  5. To verify, paste the octal output into the companion octal-to-decimal tool; the original number should come back.

How It Works: Repeated Division by 8

The hand method is repeated division, and it is worth knowing because it is the algorithm the tool implements. Divide the number by 8, keep the remainder as the rightmost octal digit, then repeat on the quotient until it reaches zero. The remainders, read bottom to top, form the octal number.

Convert 100 as a worked example. 100 divided by 8 is 12 with remainder 4. Then 12 divided by 8 is 1 with remainder 4. Then 1 divided by 8 is 0 with remainder 1. Reading the remainders from last to first gives 144, so 100 decimal is 144 octal. Check by expanding: 1 times 64 plus 4 times 8 plus 4 equals 100. The same loop converts any integer, and each division step is cheap, which is why even hundred-digit inputs convert instantly.

Decimal inputDivision trail (quotient / remainder)Octal result
88 to 1 r 0; 1 to 0 r 110
100100 to 12 r 4; 12 to 1 r 4; 1 to 0 r 1144
255255 to 31 r 7; 31 to 3 r 7; 3 to 0 r 3377
493493 to 61 r 5; 61 to 7 r 5; 7 to 0 r 7755
511511 to 63 r 7; 63 to 7 r 7; 7 to 0 r 7777
10001000 to 125 r 0; 125 to 15 r 5; 15 to 1 r 7; 1 to 0 r 11750

The 493 row is the practical one for sysadmins: 493 is the decimal value a library reports for mode 755, and the division trail recovers the familiar digits directly. The 1000 row shows why the bottom-up reading matters; the remainders come out 0, 5, 7, 1 and must be reversed to 1750.

Common Use Cases

  • Producing chmod arguments from library values: when a programming API reports a file mode as decimal, convert it to octal to get the number chmod understands.
  • Learning positional notation: repeated division is the standard classroom method, and checking your remainders against a live tool cements the algorithm.
  • Interpreting old data formats: tar archives, some log formats, and legacy configuration files store numeric fields as octal text, so converting your decimal target tells you what string to search for.
  • Cross-checking bit fields: embedded documentation that lists a register value in decimal is easier to align with 3-bit hardware fields once it is in octal.
  • Puzzle chains: escape-room and CTF sequences frequently bounce between bases; this is the leg that goes back toward the octal layer.

Decimal-to-Octal Compared with Decimal-to-Hex

The algorithms are identical except for the divisor: 8 for octal, 16 for hex. What differs is the output's shape. Octal digits map to 3-bit groups, so the result aligns with permission triples and legacy word sizes; hex digits map to 4-bit groups, so the result aligns with bytes and modern word sizes. 255 becomes 377 in octal and FF in hex, both correct views of the same eight bits.

Choose octal when the destination is chmod, umask, a tar field, or anything Unix-permission shaped. Choose hex when the destination is an address, a byte-level protocol, or a color code. If you only need the raw bits underneath, converting decimal to binary directly is another path, though its output is eight times longer per byte and harder to eyeball.

Tips and Best Practices

  • Read remainders bottom-up; writing them top-down in order is the single most common hand-conversion mistake, and it produces digits that are a permutation of the right answer.
  • Sanity-check digit count: each octal digit covers a factor of 8, so 100 decimal needs three octal digits, and a two-digit answer is automatically wrong.
  • Verify by expansion, not by eye: multiply the digits back through the 64, 8, 1 weights and confirm the original decimal total.
  • When writing octal literals in code, prefix with a leading zero or an explicit 0o marker per your language's rules; a bare 144 in C means one hundred forty-four, not one hundred.
  • For permission arithmetic, keep the shortcuts handy: 493 is 755, 420 is 644, 384 is 600, and 511 is 777.

Frequently Asked Questions

How do I convert decimal to octal by hand?
Divide the number by 8 repeatedly and collect remainders. Each division produces one octal digit, starting from the least significant. For 100: 100 divided by 8 gives quotient 12 remainder 4, then 12 divided by 8 gives quotient 1 remainder 4, then 1 divided by 8 gives quotient 0 remainder 1. Reading the remainders from last to first gives 144, so 100 decimal is 144 octal. Always read bottom-up; reversing the order is the most common mistake and yields a wrong but plausible-looking number.
What is 100 in octal?
144. The division trail is 100 to 12 remainder 4, then 12 to 1 remainder 4, then 1 to 0 remainder 1, and reading the remainders backward gives 144. You can verify by expanding: 1 times 64 plus 4 times 8 plus 4 equals 64 plus 32 plus 4, which is 100. This particular pair appears constantly in textbooks because it is large enough to need three octal digits but small enough to check mentally in a few seconds.
Why does 493 convert to 755, and what does that have to do with chmod?
493 divided by 8 is 61 remainder 5, 61 divided by 8 is 7 remainder 5, and 7 divided by 8 is 0 remainder 7, so the octal form is 755. The connection: a Unix file permission is nine bits, three per user class, and 493 is the decimal value of the bit pattern rwxr-xr-x. Tools like chmod accept that pattern written in octal, as 755, so converting a library-reported decimal mode like 493 into octal gives you exactly the argument the command expects.
Can this tool convert negative numbers or decimals like 3.5?
No, and that is a deliberate boundary. Base conversion of fractional values involves a different algorithm, repeated multiplication of the fractional part, and produces non-terminating digits in some cases, so mixing it with integer conversion invites silent errors. This page handles non-negative integers only, treating the whole input as one big integer. If your value is negative, convert its absolute value and add the sign yourself; if it has a fractional part, convert the integer portion here and handle the fraction separately with a specialized tool.
How can I check that my octal answer is correct?
Convert it back. Feed the octal result into octal-to-decimal and confirm the original number returns; that round trip catches nearly every manual error. You can also expand by hand: multiply each octal digit by its position weight, 1, 8, 64, 512, and add the products. For 144 that is 64 plus 32 plus 4, or 100. A third quick check is magnitude: an N-digit octal number lies between 8 to the N-1 and 8 to the N minus 1, so 144 must be at least 64 and below 512, which 100 satisfies.
Why do programming languages treat a leading zero as octal?
Historical convention inherited from early compilers and Unix: a numeric literal starting with 0, such as 0755, is interpreted as base 8, so 0755 means 493 while 755 means 755. C, JavaScript, shell arithmetic, and older Python all follow this rule, and modern dialects add the clearer 0o prefix as an alternative. The convention exists because octal was the dominant base in the systems those languages were born in. Always add the leading zero deliberately when you mean octal, and be alert when copying numbers from config files where 644 might already be octal.

Related Tools