Decimal to octal — base-10 to base-8
Enter a whole number and this tool returns its octal (base 8) value, plus the binary and hexadecimal forms. Octal is most familiar from Unix file permissions (modes like 755 and 644) and from older computing systems where bits are grouped in threes.
How it works
Octal is base 8, using only the digits 0-7. Each octal digit represents exactly three binary bits, since 2³ = 8. To convert, the number is repeatedly divided by 8 and the remainders are read in reverse order. For example, 420 divides as:
420 ÷ 8 = 52 remainder 4
52 ÷ 8 = 6 remainder 4
6 ÷ 8 = 0 remainder 6
Reading the remainders from bottom to top gives 644 in octal. In the Unix permission context, each digit is the sum of read (4), write (2) and execute (1) for a class of user.
Unix file permissions — the most common use of octal
The three-digit octal mode used by chmod maps directly to the three groups of permission bits in a Unix file:
| Octal digit | Binary | Permissions |
|---|---|---|
| 0 | 000 | --- (none) |
| 1 | 001 | —x (execute only) |
| 2 | 010 | -w- (write only) |
| 3 | 011 | -wx (write + execute) |
| 4 | 100 | r— (read only) |
| 5 | 101 | r-x (read + execute) |
| 6 | 110 | rw- (read + write) |
| 7 | 111 | rwx (read + write + execute) |
The three digits in order are: owner, group, others. So:
755= owner rwx (7), group r-x (5), others r-x (5) — typical for directories and executables644= owner rw- (6), group r— (4), others r— (4) — typical for regular files600= owner rw- (6), group --- (0), others --- (0) — private files like SSH keys777= everyone rwx — avoid on shared systems
Cross-base reference
| Decimal | Octal | Binary | Hex |
|---|---|---|---|
| 8 | 10 | 1000 | 8 |
| 64 | 100 | 1000000 | 40 |
| 255 | 377 | 11111111 | FF |
| 420 | 644 | 110100100 | 1A4 |
| 511 | 777 | 111111111 | 1FF |
Historical context
Octal was important on early minicomputers — PDP-8, PDP-11, and others from DEC — where word widths of 12, 18, or 36 bits divided evenly into 3-bit groups, making octal a natural fit for manual inspection of memory dumps. Hexadecimal (4-bit groups) later became dominant with 8-bit and 16-bit bytes, but octal persists in Unix permissions because the permission model itself is built on 3-bit groups.
The conversion runs entirely in your browser — nothing is uploaded.