Decimal to Octal Converter
Type a whole number to see it in octal, worked out by repeated division by 8.
Decimal uses only the digits 0–9
In octal (base 8)
755
Decimal 493 is 755 in octal (base 8).
7×64 + 5×8 + 5 = 493
Tap a digit to step it up. Each tile is worth its digit × 8n.
Bytes in memory2 bytes, big- and little-endian
The +0, +1 … under each byte is its address offset. Big-endian puts the most significant byte first; little-endian puts it last.
How to convert decimal to octal
Divide by 8 and keep the remainder (0 to 7). Divide the quotient by 8 again, and continue until the quotient is 0. The remainders read from last to first are the octal digits.
For 420: 420 ÷ 8 = 52 r 4, 52 ÷ 8 = 6 r 4, 6 ÷ 8 = 0 r 6. Reading upward gives 644, the usual permission for a file that its owner can edit and everyone can read.
Through binary also works: write the number in binary and split it into groups of three bits from the right; each group is one octal digit.
n = 8 × q + r, with r from 0 to 7
- Unix permissions are three octal digits, for owner, group and others; each digit adds read (4), write (2) and execute (1). Source: POSIX chmod, The Open Group Base Specifications.
Common Unix permission modes
Each mode as octal (what chmod takes), as symbols (what ls -l shows) and as a decimal number.
| Octal | Symbolic | Decimal | Typical use |
|---|---|---|---|
| 400 | r-------- | 256 | read-only key file (SSH) |
| 444 | r--r--r-- | 292 | read-only for everyone |
| 600 | rw------- | 384 | private file |
| 640 | rw-r----- | 416 | config readable by a group |
| 644 | rw-r--r-- | 420 | normal file |
| 664 | rw-rw-r-- | 436 | shared file in a group |
| 700 | rwx------ | 448 | private folder or script |
| 750 | rwxr-x--- | 488 | program for one group |
| 755 | rwxr-xr-x | 493 | program or public folder |
| 775 | rwxrwxr-x | 509 | shared group folder |
Show all 11 rowsShow fewer
| 777 | rwxrwxrwx | 511 | everyone can do everything (avoid) |
Frequently Asked Questions
What is 8 in octal?
Eight is 10 in octal: there is no digit 8, so the count rolls over to the next place, the same way 9 + 1 becomes 10 in decimal.
How do I get the octal permission from rwxr-xr-x?
Score each group of three: r = 4, w = 2, x = 1. rwx = 7, r-x = 5, r-x = 5, so the mode is 755.
Can I convert a decimal fraction to octal?
Yes, by multiplying the fraction part by 8 repeatedly and taking the whole-number parts as digits (0.5 is 0.4 in octal). This converter handles whole numbers.