ob

Octal to Binary

βœ“ Free & no signup πŸ”’ Runs 100% in your browser Updated 2026-11-25 Binary Converter Tools

Octal and binary fit together like puzzle pieces, because 8 is a power of 2: every octal digit expands into exactly three bits, no rounding, no ambiguity. Paste any octal number into this tool and the binary expansion appears live as you type, with each digit keeping its own clean 3-bit slot. The conversion runs entirely inside your browser, so the number never travels anywhere, the page is free with no signup, and it works the same on a phone as on a desktop.

Take the octal number 17 as a warm-up. The digit 1 expands to the three bits 001, and the digit 7 expands to 111. Concatenating them gives 001111. Notice the leading zeros are kept: that is deliberate, because dropping them would blur which bits belong to which digit. The output length is always exactly three times the digit count, which makes the mapping visible and the reverse conversion trivial.

One everyday example motivates almost all real-world octal work: Unix file permissions. The familiar chmod value 755 expands to 111101101 in binary, and those nine bits read directly as the permission string rwxr-xr-x. If you have ever wondered what those digits actually mean at the bit level, this tool shows you in a single keystroke.

What Is Octal and Why Three Bits per Digit?

Octal is base 8, a number system with eight digits: 0, 1, 2, 3, 4, 5, 6, and 7. There is no digit 8 or 9, which trips up people seeing octal for the first time; if your input contains an 8 or a 9, this tool shows an error message pointing at the invalid digit rather than guessing. Each octal position carries a power of 8, so 17 in octal means 1 times 8 plus 7, which is 15 in decimal.

The clean relationship with binary comes from arithmetic: 8 equals 2 to the third power, so one octal digit encodes exactly three bits. Three bits can represent 000 through 111, which is 0 through 7, precisely the octal digit range. This is the same trick hexadecimal uses with 4 bits per digit, except octal groups are smaller.

History explains why octal stuck around at all. Early computers such as the PDP-8 and PDP-11 had word sizes of 12, 24, or 36 bits, all divisible by 3, so octal grouped their bits evenly. Unix inherited octal from that lineage and baked it into file permissions, where those nine permission bits divide perfectly into three groups of three. Modern hardware prefers 32- and 64-bit words, which is why hexadecimal dominates now, but octal survives wherever 3-bit groups are natural.

How to Use This Tool (Step by Step)

  1. Type or paste your octal number into the input box. Only digits 0 through 7 are accepted; anything else triggers a clear invalid-digit error.
  2. Watch the binary output update live on every keystroke. There is no convert button to press.
  3. Read the output as one continuous bit string, or mentally split it into groups of three to see each digit's contribution.
  4. Use the copy button to take the result into your notes, terminal, or homework.
  5. To go the other direction, paste the bits into the companion binary-to-octal tool; grouping in threes from the right restores the original digits.

Worked Examples You Can Check by Hand

Each row follows the same rule: look up each digit's 3-bit pattern and concatenate. These make good self-test exercises.

Octal inputDigit-by-digit expansionBinary output
17001 111001111
7111111
755111 101 101111101101
644110 100 100110100100
1234001 010 011 100001010011100
0000000

A note on the first row: 17 in octal is 15 in decimal, and the minimal binary for 15 is 1111. The tool outputs 001111 because it preserves every digit's 3-bit slot, including the leading zeros. If you need the shortest form, strip leading zeros yourself; the numeric value is unchanged. Keeping the full width is usually more useful, because it makes the digit boundaries visible and the reverse conversion unambiguous.

The Permission Angle: Reading 755 as rwxr-xr-x

Unix permission digits are worth decoding in full because they combine octal, binary, and meaning in one place. Each digit describes one class of user: the first for the file's owner, the second for the group, and the third for everyone else. Each digit is a sum of three bit values: read counts 4, write counts 2, and execute counts 1.

So 755 means the owner digit 7 is 4 plus 2 plus 1, binary 111, which is read, write, and execute. The group digit 5 is 4 plus 1, binary 101, which is read and execute but not write. The final 5 repeats that for others. Concatenated, 111101101 lines up with the symbolic string rwxr-xr-x character for character. The value 644 expands to 110100100, which is rw-r--r--, the typical setting for a plain text file. Once you can see the nine bits, the whole chmod system stops being mysterious.

This mapping is also why permission digits never contain an 8 or 9: the maximum, 7, already uses all three bits. Any tool or tutorial showing a permission like 888 is simply wrong.

How the Conversion Works Internally

The algorithm is a fixed lookup, not a division procedure. Each octal digit maps to its 3-bit pattern: 0 to 000, 1 to 001, 2 to 010, 3 to 011, 4 to 100, 5 to 101, 6 to 110, and 7 to 111. The tool walks the input left to right, replaces every digit with its pattern, and concatenates the results. Input length does not matter, because each digit is handled independently; a 12-digit octal number produces a 36-bit string without any overflow concerns.

Validation happens before conversion. Characters outside 0 through 7, including spaces in unexpected places, letters, and the digits 8 and 9, produce an error message that names the offending character. Nothing is silently skipped, because a silently dropped digit would shift every bit that follows and produce a plausible-looking but wrong answer, which is the worst kind of bug.

Common Use Cases

  • Debugging file permissions: expand a chmod value to bits to see exactly which of the nine flags are set, then compare against what the security policy expects.
  • Teaching number bases: the digit-to-triplet mapping is the most visual way to demonstrate that bases linked by powers of two convert without arithmetic.
  • Embedded and legacy work: some device registers and older protocols document fields in octal; expanding to bits shows the individual flags.
  • Verifying umask math: subtracting a umask from 777 is easier to trust when you can see the bit patterns side by side.
  • CTF challenges: beginner puzzles frequently hide permission-style octal strings, and quick bit expansion reveals the intended reading.

Tips and Best Practices

  • Strip leading zeros only when you need the minimal binary form; keeping them preserves the visible 3-bit rhythm and makes errors easier to spot.
  • Check your work by converting back: feed the binary output into binary-to-octal and confirm the original digits return.
  • Remember that octal literals in C, JavaScript, and shell scripts often carry a leading zero, as in 0755. The zero is notation, not a digit; enter just 755 here unless you want an extra 000 group in the output.
  • When comparing two permission values, convert both to binary and align them; bit-by-bit differences are obvious, while decimal differences are not.
  • For very long octal strings, convert in sections if rendering feels slow; the per-digit mapping means sections can be concatenated safely at any 3-bit boundary.

Frequently Asked Questions

How do I convert octal to binary by hand?
Replace each octal digit with its 3-bit pattern: 0 becomes 000, 1 becomes 001, 2 becomes 010, 3 becomes 011, 4 becomes 100, 5 becomes 101, 6 becomes 110, and 7 becomes 111. Then write the patterns in order. For 755 you get 111, 101, 101, which concatenate to 111101101. No arithmetic is needed at all, because 8 is a power of 2. If the leading group starts with zeros and you want the shortest form, you can drop them, as in 17 octal becoming 1111 instead of 001111.
Why does each octal digit equal exactly three bits?
Because 8 is 2 to the third power. Three bits can take 2 to the 3rd, or 8, distinct values, which is exactly the count of octal digits 0 through 7. Each digit corresponds to one 3-bit group: the pattern 101 is 5, 110 is 6, and so on. Hexadecimal works the same way with 4 bits per digit because 16 is 2 to the fourth power. Only bases that are powers of 2 convert digit-by-digit without arithmetic; decimal, for example, requires real division.
What is 755 in binary and what do the bits mean for file permissions?
755 expands to 111101101. Split into three groups of three, 111 is the owner, 101 is the group, and 101 is others. Each group maps to read, write, execute: the first bit is read, the second write, the third execute. So 111 is rwx, full control for the owner, while 101 is r-x, read and execute without write, for everyone else. That is exactly the symbolic string rwxr-xr-x shown by ls -l. The digit 7 comes from 4 plus 2 plus 1, and 5 from 4 plus 1.
Why does my octal input with an 8 or 9 give an error?
The octal system only has the digits 0 through 7, so a number containing 8 or 9 is not a valid octal number, and the tool reports the invalid character instead of converting it. This surprises people because 8 and 9 look like ordinary digits, but in base 8 the digit 9 has no meaning, the way the digit 2 has no meaning in binary. Check your source: many so-called octal values with 8 or 9 are actually decimal numbers that need the decimal-to-octal tool first.
Do leading zeros in the octal input change the binary output?
They add bits but never change the value. A leading zero digit produces an extra 000 group, so 17 gives 001111 while 017 gives 000001111. Both represent the same number, 15 in decimal. The tool keeps the zeros because preserving one 3-bit group per input digit makes the mapping transparent and the reverse conversion exact. Programming languages also use a leading zero to mark octal literals, as in 0755, so keep that in mind when copying numbers out of code.
Where is octal still used in modern computing?
The most visible survivor is Unix file permissions: chmod 644, umask values, and the rwx strings printed by ls -l are all octal. You will also meet it in C-style character escapes such as the three-digit patterns used inside string literals, in some embedded systems and legacy protocols whose word sizes were multiples of 3 bits, and in tar file headers, which store fields as octal text. Hexadecimal has taken over most other roles because modern word sizes are multiples of 4 bits, but octal remains essential for permissions.

Related Tools