What is Octal?

Octal is a base-8 number system that uses digits 0 through 7. Unlike decimal (base 10) or binary (base 2), octal groups binary digits into sets of three, which made it a natural shorthand for older computing systems.

Why Was Octal Used in Computing?

Before hexadecimal became the standard, octal was widely used in early computing โ€” particularly with 6-bit, 12-bit, and 36-bit architectures (which divided evenly into groups of 3 bits). Some early programming languages and Unix/Linux systems still use octal today for file permissions.

Unix File Permissions in Octal

If you've ever used chmod 755 or chmod 644 on a Linux system, you've used octal. Each digit represents three bits for owner, group, and others:

Octal to Decimal Conversion

Example: 57 in octal

Binary to Octal Shortcut

Group binary digits into sets of 3 from the right, then convert each group to a single octal digit.

Convert between octal, decimal, binary and hex instantly with our number system converter.

Step-by-Step Conversion Examples

Setting Linux File Permissions with chmod

The most common real-world use of octal today is Unix/Linux file permissions. The command chmod 755 script.sh sets:

The permission string displays as -rwxr-xr-x in ls -la. Common permission sets:

Binary breakdown of 644: 6 = 110 (rw-), 4 = 100 (r--), 4 = 100 (r--) โ†’ displays as rw-r--r--. Understanding the binary mapping makes permission numbers intuitive rather than arbitrary codes to memorize.

Decimal to Octal Conversion: A Worked Example

Convert 365 (decimal) to octal using repeated division by 8:

Verification: 5ร—64 + 5ร—8 + 5ร—1 = 320 + 40 + 5 = 365 โœ“

The coincidence that 365 = 555โ‚ˆ makes it a useful mnemonic โ€” 365 days in a common year. Another memorable pair: 255 decimal = 377 octal (the maximum one-byte value), and 256 decimal = 400 octal (the beginning of the next "century").

Binary to Octal: The Three-Bit Grouping Method

Binary converts to octal directly by grouping bits in threes from the right โ€” no multiplication needed. Convert binary 110 101 001 to octal:

Verification: 6ร—64 + 5ร—8 + 1 = 384 + 40 + 1 = 425 decimal. Binary check: 256+128+32+8+1 = 425 โœ“

This grouping method works because 8 = 2ยณ โ€” each octal digit maps to exactly 3 binary bits. Hexadecimal (base 16 = 2โด) groups bits in fours, which aligns better with 8-bit bytes (two hex digits per byte). This alignment advantage is why hex replaced octal in modern computing after 8-bit architectures became dominant in the late 1970s.

Octal in Programming Languages

Octal literals appear in several programming languages with different syntax โ€” knowing the convention prevents subtle bugs:

A real-world pitfall in C: chmod(path, 0644) correctly uses octal 644 (rw-r--r--). But if a developer writes chmod(path, 0844) intending "owner read+execute + group read + others read," they actually pass octal 844 = decimal 548 โ€” which maps to unusual permission bits. Always use the explicit 0o prefix in Python and Go 1.13+, and double-check octal literals in C with a converter when in doubt.

Source: IEEE POSIX.1 standard (file permissions); programming language specifications (C11, Python 3, ECMAScript 2022). Last verified: May 2026.

Frequently Asked Questions

How do I convert decimal to octal?

Divide the decimal number by 8 repeatedly and collect remainders from last to first. Example: 83 รท 8 = 10 R3; 10 รท 8 = 1 R2; 1 รท 8 = 0 R1. Reading remainders bottom-up: 123 in octal. Check: (1ร—64)+(2ร—8)+3 = 64+16+3 = 83. Our Number Systems converter does this instantly.

Where is octal actually used today?

Octal is most commonly seen in Unix/Linux file permissions. The chmod command uses octal: chmod 755 means owner=7 (rwx), group=5 (r-x), others=5 (r-x). Each octal digit (0โ€“7) maps to three binary digits (read, write, execute), making permissions easy to express in a single digit per role.

Is octal the same as base 8?

Yes. Octal is another name for base 8 โ€” it uses only the digits 0 through 7. Each octal digit corresponds to exactly 3 binary digits: 0=000, 1=001, 2=010, 3=011, 4=100, 5=101, 6=110, 7=111. Before hexadecimal became dominant, octal was widely used as a compact binary shorthand in computing.

Convert between octal, decimal, binary, and hexadecimal instantly.

โšก Binary & Number Systems Converter โ€” Free

Accuracy note: Conversion factors on SwiftConvertHub are sourced from NIST and IEC standards. Results are accurate for general use. For safety-critical or professional applications, verify results independently. Full disclaimer โ†’

๐Ÿ‘ค
Written by
Victor A. Calvo S.

Victor A. Calvo S. is a software engineer and digital entrepreneur who builds practical, free tools for developers, students, and professionals worldwide. He is the creator of SwiftConvertHub, InstantLinkHub, and Feexio. All conversion factors are cross-referenced against NIST and IEC standards. Learn more โ†’