How it works
Decimal counts in base 10, octal counts in base 8. Converting means rewriting the same quantity with a different set of digits — the value never changes, only how it is written.
- Divide the decimal number by 8.
- Write down the remainder — that is the last digit of the octal number.
- Repeat with the quotient until it reaches zero, then read the remainders bottom to top.
The reverse conversion is Octal to Decimal, which also handles every other base pair.
Examples
Worked examples, digit by digit:
- 10 (decimal) = 10 in decimal = 12 (octal)
- 21 (decimal) = 21 in decimal = 25 (octal)
- 255 (decimal) = 255 in decimal = 377 (octal)
| Decimal | Binary | Octal | Hexadecimal |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 |
| 2 | 10 | 2 | 2 |
| 4 | 100 | 4 | 4 |
| 8 | 1000 | 10 | 8 |
| 10 | 1010 | 12 | A |
| 15 | 1111 | 17 | F |
| 16 | 10000 | 20 | 10 |
| 32 | 100000 | 40 | 20 |
| 64 | 1000000 | 100 | 40 |
| 100 | 1100100 | 144 | 64 |
| 255 | 11111111 | 377 | FF |
Decimal to Octal: frequently asked questions
- How do I convert decimal to octal?
- Divide the number by 8 repeatedly and read the remainders from bottom to top. For example, decimal 45 is 55 in octal. The converter above does this instantly for any value.
- What is 255 in octal?
- Decimal 255 equals 377 in octal (the value 255, the largest number that fits in one byte).
- Why are decimal and octal used?
- Decimal (base 10) is the everyday number system. Octal (base 8) groups bits in threes.
