Binary to Octal Converter
Type a binary number to see it in octal, three bits per digit, the way Unix permission bits (rwx) are read.
Binary uses only 0 and 1
In octal (base 8)
644
Binary 1 1010 0100 is 644 in octal (base 8).
6×64 + 4×8 + 4 = 420
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 binary to octal
Since 8 = 2³, each octal digit stands for exactly three bits. Split the binary number into groups of three starting from the right, pad the leftmost group with zeros, and write each group as its digit from 0 to 7.
For 111101101: the groups are 111, 101 and 101, which are 7, 5 and 5, so the octal number is 755. In a permission string those three groups are rwx, r-x and r-x.
Only eight patterns exist, so the table below is the whole method: 000 = 0, 001 = 1, 010 = 2, 011 = 3, 100 = 4, 101 = 5, 110 = 6, 111 = 7.
3 bits = 1 octal digit (000 = 0 … 111 = 7)
- POSIX permission bits come in threes (read, write, execute) for owner, group and others, which is why chmod modes are octal. Source: POSIX chmod, The Open Group Base Specifications.
The 8 three-bit groups
Every 3-bit group, its octal digit and the permission it gives when read as rwx.
| 3 bits | Octal | As rwx |
|---|---|---|
| 000 | 0 | --- |
| 001 | 1 | --x |
| 010 | 2 | -w- |
| 011 | 3 | -wx |
| 100 | 4 | r-- |
| 101 | 5 | r-x |
| 110 | 6 | rw- |
| 111 | 7 | rwx |
Frequently Asked Questions
Why three bits per octal digit?
Three bits make 2³ = 8 patterns, exactly one per octal digit 0 to 7. That one-to-one match is what lets you convert by grouping instead of dividing.
What is 101 in octal?
Binary 101 is one group of three, which is the octal digit 5 (4 + 1).
Should I group from the left or the right?
Always from the right, where the ones place is. Grouping 1101 from the left would give 110 1, but the correct groups are 001 101, which is 15 in octal.