2.3 Octal Number System: Base-8 and Binary Grouping in Threes

Convert between binary and octal by grouping bits in threes, and recognize why only digits 0-7 are valid in octal.

The octal number system is base-8, using only the digits 0 through 7. Its main practical value in digital electronics is as a compact shorthand for binary: because 8 is a power of 2 (2^3), each octal digit corresponds to exactly three binary bits, making octal a quick, error-resistant way to write and read long binary numbers by eye — a role it historically filled heavily in systems with word sizes that were multiples of 3 bits, before hexadecimal became the dominant shorthand for 8-bit-oriented systems.

Why base 8 groups bits in threes

Since 2^3 = 8, every possible 3-bit binary combination (000 through 111) maps to exactly one octal digit (0 through 7), with no gaps and no overlap. This clean correspondence is what makes octal-binary conversion mechanical rather than arithmetic: you don't need to compute powers of 2 and sum them — you simply split the binary number into groups of three bits (starting from the right) and translate each group independently.

This grouping relationship — base 8 groups binary bits in threes, base 16 (covered next) groups them in fours — is the general principle behind using any power-of-2 base as binary shorthand, and it is worth internalizing as a pattern rather than memorizing each base's conversion table separately.

Valid octal digits

Octal uses only the digits 0, 1, 2, 3, 4, 5, 6, and 7 — there is no octal digit 8 or 9, because a single octal digit can represent at most 7 (binary 111); reaching a value of 8 requires carrying into a new digit position, exactly as reaching 10 in decimal requires carrying into a new decimal position. Any numeral containing an 8 or 9 is simply not a valid octal number.

Binary-to-octal grouping

Padding only ever adds zeros to the left (most-significant) end of the binary number — it never changes the number's value, only its bit-grouping alignment.

Group binary bits into sets of 3, starting from the LSB (right side);
pad the leftmost group with leading zeros if needed.

Octal digit table (3 bits -> 1 octal digit):
  000=0  001=1  010=2  011=3
  100=4  101=5  110=6  111=7

Code Examples

The 6-bit binary number 101110 is already a multiple of 3 bits, so it splits cleanly into two groups: 101 and 110. Each group is translated independently using the 3-bit table: 101 = 5, and 110 = 6, giving the octal result 56.

101 110_2
 |    |
 5    6

101 110_2 = 56_8

3-bit groups mapping to octal digits

Each group of exactly 3 binary bits maps directly to one octal digit (0-7), with no carrying or summation needed.

Binary:  1 0 1 . 1 1 0
         \___/   \___/
           5        6

       Octal:   5    6   ->  56_8

Important Rules

Octal is base-8, using only digits 0 through 7 — the digit 8 (and 9) is never valid in octal.

Because 8 = 2^3, one octal digit represents exactly 3 binary bits with a fixed, mechanical mapping.

To convert binary to octal, group bits into sets of 3 starting from the LSB, padding the leftmost group with leading zeros if the total bit count is not a multiple of 3.

To convert octal to binary, expand each octal digit into its 3-bit binary equivalent and concatenate the groups in order.

Where this shows up

Octal remains common today for representing Unix/Linux file permission bits (e.g., chmod 755), because each octal digit conveniently encodes exactly 3 permission bits (read, write, execute) for one of the owner/group/other categories — a direct, practical descendant of octal's core property of grouping binary bits in threes.

Writing or accepting an octal numeral that contains the digit 8 or 9, such as '89_8'.

Recognize that octal digits only range from 0 to 7; a value that would need an '8' must instead carry over, exactly as decimal carries at 10.

The digit 8 is invalid in octal. Any numeral using 8 or 9 is not a legitimate base-8 number, and such a numeral either signals a mistake or, in some contexts, that the number is actually decimal rather than octal.

[tricky] Is '289' a valid octal number? A. Yes, octal allows all digits 0-9 B. No — the digits 8 and 9 do not exist in octal, which only uses 0 through 7 C. Yes, but only in unsigned octal representations D. It depends on the number of bits used

B. No — the digits 8 and 9 do not exist in octal, which only uses 0 through 7 — The digit 8 (and 9) is invalid in octal. Octal is base-8 and only uses digits 0 through 7; any numeral containing an 8 or 9 cannot be a valid octal number.

[interview] Why does octal correspond so cleanly to binary, unlike, say, base-7 or base-9? A. It doesn't — octal-to-binary conversion actually requires the same arithmetic as any other base B. Because 8 is a power of 2 (2^3), so every 3-bit binary pattern maps to exactly one octal digit with no remainder or overlap C. Because octal was specifically designed by binary computer manufacturers with no mathematical reason D. Because binary numbers are always a multiple of 8 bits long

B. Because 8 is a power of 2 (2^3), so every 3-bit binary pattern maps to exactly one octal digit with no remainder or overlap — Octal's usefulness as binary shorthand comes directly from 8 being a power of 2 (2^3): this means the 8 possible 3-bit binary patterns (000-111) map one-to-one onto the 8 octal digits (0-7), making the conversion a simple grouping operation rather than an arithmetic one — a property base-7 or base-9 do not share.

Convert the binary number 11010111_2 to octal. (Hint: 8 bits is not a multiple of 3, so pad with leading zeros first.)

Padded to 9 bits: 011 010 111. Groups: 011=3, 010=2, 111=7. So 11010111_2 = 327_8.

Pad 11010111 on the left to make its length a multiple of 3, then split into 3-bit groups from the right.