How to Convert Octal Numbers

Octal (base-8) uses the digits 0 through 7 and was the dominant shorthand for binary in 1960s and 1970s computing — an era when word sizes (6, 12, 24, 36 bits) were divisible by 3. Today you encounter octal every time you set Unix/Linux file permissions: the command chmod 755 is three octal digits, each encoding three binary permission flags. Because 8 = 2³, one octal digit represents exactly three binary bits — making octal-to-binary and binary-to-octal conversions pure look-up operations with no arithmetic at all.

How Octal Positional Notation Works

Just as decimal positions represent powers of 10 (1, 10, 100, …), octal positions represent powers of 8. The rightmost digit is 8⁰ = 1, the next is 8¹ = 8, then 8² = 64, 8³ = 512, and so on. To find the decimal value of any octal number, multiply each digit by its positional power of 8 and add the products.

Position43210
Power of 88⁴8⁰
Decimal value40965126481

Octal → Decimal: Positional Notation

  1. Label each octal digit's position from 0 (rightmost) increasing to the left.
  2. Multiply each digit by 8 raised to its position (8⁰=1, 8¹=8, 8²=64, 8³=512, …).
  3. Add all the products together.

Worked Example 1 — Convert (52)₈ to Decimal

A two-digit octal number. Position 1 has digit 5, position 0 has digit 2.

(52)₈ = 42₁₀. Verify: 42 ÷ 8 = 5 R 2, 5 ÷ 8 = 0 R 5 → read bottom to top: 52₈ ✓

Worked Example 2 — Convert (374)₈ to Decimal

A three-digit octal number. Each digit is multiplied by the corresponding power of 8.

Digit374
Position210
Positional value6481
Product192564
(374)₈ = 252₁₀. Verify: 252 ÷ 8 = 31 R 4, 31 ÷ 8 = 3 R 7, 3 ÷ 8 = 0 R 3 → read bottom to top: 374₈ ✓

Octal → Binary: Direct 3-Bit Substitution

Because 2³ = 8, each octal digit corresponds to exactly 3 binary bits. The full mapping has only 8 entries — memorize it once and you can convert any octal number to binary instantly, without any arithmetic. Just replace each octal digit with its 3-bit equivalent.

Octal digit3-bit binaryOctal digit3-bit binary
00004100
10015101
20106110
30117111

Worked Example — Convert (374)₈ to Binary

Replace each of the three octal digits with its 3-bit binary equivalent:

Octal digit374
3-bit binary011111100
(374)₈ = (011111100)₂. You can drop the leading zero: (11111100)₂. Verify: 128+64+32+16+8+4 = 252₁₀ = (374)₈ ✓

Worked Example — Convert (52)₈ to Binary

Octal digit52
3-bit binary101010
(52)₈ = (101010)₂. Verify: 32+8+2 = 42₁₀ = (52)₈ ✓

Octal → Hexadecimal: Via Binary

There is no direct octal-to-hex table because 8 and 16 do not share a simple power relationship. The standard approach uses binary as an intermediate step: expand each octal digit to 3 bits, concatenate all bits into one binary string, then regroup those bits into 4-bit chunks and convert each chunk to a hex digit.

  1. Expand each octal digit to its 3-bit binary equivalent.
  2. Concatenate all bits into one binary string.
  3. Pad the leftmost end with zeros until the total bit count is a multiple of 4.
  4. Split into 4-bit groups from right to left.
  5. Convert each 4-bit group to its hex digit (0–9, A–F).

Worked Example — Convert (374)₈ to Hexadecimal

Step 1: expand to binary — (374)₈ → 011 111 100 → binary string 011111100 (9 bits). Step 2: pad to 12 bits → 000011111100. Step 3: split into 4-bit groups: 0000 | 1111 | 1100.

4-bit group000011111100
Decimal value01512
Hex digit0FC
(374)₈ = (FC)₁₆ (drop the leading 0). Verify: 15×16 + 12 = 240 + 12 = 252₁₀ ✓

Real-World Use: Unix File Permissions

Unix and Linux represent file permission sets as three binary flags — read (r), write (w), execute (x) — for each of three groups: owner, group, and others. Since each flag is a single bit and each group has 3 flags, one octal digit perfectly encodes one group's permissions. This is why chmod uses three octal digits.

Octal digitBinary (rwx)Permission meaning
7111read + write + execute (full access)
6110read + write
5101read + execute
4100read only
3011write + execute
2010write only
1001execute only
0000no permissions
💡chmod 755 = owner:rwx (7=111), group:r-x (5=101), others:r-x (5=101). Full binary: 111 101 101. This is the standard permission for public executable files.

Frequently Asked Questions

What digits are valid in an octal number?

Only 0 through 7. The digits 8 and 9 do not exist in octal — octal base-8 can only use digits whose value is less than the base. If you see an 8 or 9 in a supposed octal number, it is not a valid octal value.

Why is octal less common than hexadecimal today?

Modern computing is built around 8-bit bytes. One byte = 8 bits = exactly two hex digits (since 2⁴ = 16). Octal's 3-bit grouping doesn't align neatly with 8-bit bytes — you need 3 octal digits for 9 bits, but a byte has only 8. Hex's 4-bit grouping aligns perfectly. This is why hex became the dominant compact representation for binary data.

Is octal still used in modern computing?

Yes, though mainly in two places: Unix/Linux file permissions (chmod) and escape sequences in programming languages. Languages like C, Python, and JavaScript allow octal literals using a leading zero (0755 in C) or the 0o prefix (0o755 in Python). Octal escape sequences like \077 also appear in some string contexts.

How do I convert a decimal number to octal?

Use the repeated division algorithm: divide by 8, record the remainder, divide the quotient by 8 again, and repeat until the quotient is 0. Read the remainders from bottom to top. For example, 252 ÷ 8 = 31 R 4, 31 ÷ 8 = 3 R 7, 3 ÷ 8 = 0 R 3 → read bottom to top: 374₈.