Back to Lingo

Octal

Data Encoding

Octal is a base-8 number system that uses digits 0 through 7. It serves as a compact way to represent binary numbers because each octal digit corresponds to exactly three bits. While less common than hexadecimal in modern programming, octal still appears in specific contexts like Unix file permissions and some legacy computing systems.

Why it matters

Octal provides a human-friendly way to work with binary data in groups of three bits. Instead of reading 111101011, you can write 753 in octal, which is much easier to remember and communicate. If you work with Unix or Linux systems, you will encounter octal regularly when setting file permissions using commands like chmod 755.

How to read octal

Each octal digit represents a value from 0 to 7, and each position is a power of 8. The octal number 755 means: (7×64) + (5×8) + (5×1) = 493 in decimal. In binary, it translates directly: 7 is 111, 5 is 101, so 755 in octal is 111101101 in binary. You can practice these conversions in the Building Conversion Functions lesson.

Unix file permissions

The most common place you will see octal is in Unix file permissions. Each digit represents permissions for owner, group, and others. The values are: 4 for read, 2 for write, and 1 for execute. So 755 means the owner can read, write, and execute (7 = 4+2+1), while group and others can only read and execute (5 = 4+1). The lesson Where Number Systems Are Used explains this in more detail.

See more

Further reading

You need to be signed in to leave a comment and join the discussion