Decimal to Octal Converter
Enter any whole number in decimal (base 10) and this converter gives you the octal (base 8) result along with the binary and hexadecimal equivalents. The steps panel walks through every division-by-8 iteration so you can follow the math exactly. Need to go the other way? Switch the mode to Octal to Decimal and convert back in one click.
Formula
Worked example
Convert 255 to octal: 255 / 8 = 31 remainder 7; 31 / 8 = 3 remainder 7; 3 / 8 = 0 remainder 3. Read remainders bottom to top: 3, 7, 7 = (377)8. Verify: 3 x 64 + 7 x 8 + 7 = 192 + 56 + 7 = 255.
How the decimal to octal conversion works
Decimal is the base-10 number system we use every day, with digits 0 through 9. Octal is the base-8 system, which uses only digits 0 through 7. To convert a decimal number to octal, repeatedly divide the number by 8 and record the remainder at each step. Once the quotient reaches zero, read the remainders from the last division back to the first. That sequence of remainders, read in reverse order, is your octal result. For example, 255 divided by 8 gives 31 remainder 7; 31 divided by 8 gives 3 remainder 7; 3 divided by 8 gives 0 remainder 3. Reading the remainders in reverse: 3, 7, 7, so 255 in decimal is 377 in octal.
Converting octal back to decimal
To convert octal to decimal, treat each octal digit as a coefficient multiplied by 8 raised to the power of its position. Position counting starts at 0 from the rightmost digit. For (377)8: 7 x 8^0 = 7, 7 x 8^1 = 56, 3 x 8^2 = 192. Adding these: 7 + 56 + 192 = 255. This positional expansion works identically to how we interpret decimal digits, except the base is 8 instead of 10. Use the Octal to Decimal mode above to verify any conversion instantly.
Why octal matters in computing
Octal was widely used in early computing because binary bit strings map cleanly onto octal digits: each octal digit represents exactly 3 binary bits. This made octal a compact and readable shorthand for binary on machines with 6-, 12-, 18-, 24-, and 36-bit word sizes. Unix and Linux file permissions still use octal notation today: the familiar "chmod 755" sets read/write/execute (7 = 111 in binary), read/execute (5 = 101), read/execute (5 = 101) for owner, group and others respectively. Modern systems more often use hexadecimal (base 16, with each hex digit representing 4 binary bits), but octal remains relevant in shell scripting and POSIX permissions.
Octal, binary and hexadecimal side by side
The three non-decimal bases commonly used in computing are octal (base 8), binary (base 2) and hexadecimal (base 16). Binary is the native language of digital hardware but is verbose. Hexadecimal is compact (one hex digit = 4 binary bits) and is used in memory addresses, color codes and machine code. Octal sits in between: one octal digit = 3 binary bits. Because 3 does not divide evenly into 8 (the 8-bit byte), octal fell out of favor for byte-oriented architectures and hexadecimal became dominant. This converter shows all three alongside the octal result so you can compare them at a glance.
Decimal to Octal quick reference (0-64)
| Decimal | Octal | Binary | Hexadecimal |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 |
| 2 | 2 | 10 | 2 |
| 3 | 3 | 11 | 3 |
| 4 | 4 | 100 | 4 |
| 5 | 5 | 101 | 5 |
| 6 | 6 | 110 | 6 |
| 7 | 7 | 111 | 7 |
| 8 | 10 | 1000 | 8 |
| 9 | 11 | 1001 | 9 |
| 10 | 12 | 1010 | A |
| 16 | 20 | 10000 | 10 |
| 32 | 40 | 100000 | 20 |
| 64 | 100 | 1000000 | 40 |
| 128 | 200 | 10000000 | 80 |
| 255 | 377 | 11111111 | FF |
| 256 | 400 | 100000000 | 100 |
| 512 | 1000 | 1000000000 | 200 |
| 1024 | 2000 | 10000000000 | 400 |
| 4096 | 10000 | 1000000000000 | 1000 |
Common decimal values with their octal, binary and hexadecimal equivalents.
Frequently asked questions
What digits are allowed in octal?
Octal uses only the digits 0, 1, 2, 3, 4, 5, 6 and 7. The digit 8 and 9 do not exist in octal. If you see an 8 or 9 in a number labeled as octal it is an error.
How do I convert decimal to octal by hand?
Divide the decimal number by 8 and write down the remainder. Take the quotient and divide it by 8 again, writing down the new remainder. Keep dividing until the quotient is 0. Then read all the remainders in reverse order (last remainder first) to get the octal number. For example, 100 gives 100/8 = 12 R4, 12/8 = 1 R4, 1/8 = 0 R1, so the octal result is 144.
What is the octal equivalent of the decimal number 255?
255 in decimal equals 377 in octal. The working is: 255/8 = 31 remainder 7; 31/8 = 3 remainder 7; 3/8 = 0 remainder 3. Reading remainders from bottom to top: 3, 7, 7 = 377 in octal. You can verify this because 3 x 64 + 7 x 8 + 7 x 1 = 192 + 56 + 7 = 255.
Why does Unix file permissions use octal?
Unix permissions are stored as 3-bit groups (read, write, execute) for each of owner, group and others, giving 9 bits in total. Since one octal digit represents exactly 3 binary bits, a two-digit octal number perfectly encodes one permission group. The permission "rwxr-xr-x" in binary is 111 101 101, which in octal is 7 5 5, written as 755. Octal is both compact and unambiguous for this three-group structure.
How is octal different from hexadecimal?
Octal is base 8 and uses digits 0-7; each digit represents 3 binary bits. Hexadecimal is base 16 and uses digits 0-9 plus A-F; each digit represents 4 binary bits. For 8-bit bytes, hexadecimal is more convenient because two hex digits exactly represent one byte. Octal was more natural for older 6-, 12-, and 36-bit machines where bit groups of 3 aligned with the word size.
Can this converter handle large numbers?
Yes, for integers within the JavaScript safe integer range (up to 2^53 - 1, or about 9 quadrillion). For extremely large numbers that exceed this range, use a dedicated arbitrary-precision library.