Binary to Octal Converter
Last updated: 20 August 2026
Reviewed by Gavin · Research and drafting assisted by AI
Working — binary → octal by 3-bit grouping
3-bit → octal digit table
Verified examples
Binary to Octal Converter
A binary to octal converter turns a string of ones and zeros into base-8 notation, and back again, using a shortcut that requires no arithmetic at all. Because eight is exactly two cubed, every single octal digit corresponds to exactly three binary digits, so the conversion is a straight substitution rather than a calculation. This converter handles that substitution instantly, shows you the grouped bits so you can follow the working, and simultaneously displays the same value in decimal and hexadecimal so you never have to open a second tool.
It is used by computer science students checking homework, embedded developers reading register dumps, systems administrators translating Unix file permission bits into the familiar chmod 755 form, hardware engineers working with three-bit control fields, and anyone who has ever stared at a wall of ones and zeros and wanted a shorter way to write it down. Binary is how machines represent everything, but binary is painful for humans to read: a single 32-bit word is thirty-two characters of visual noise. Octal compresses that to eleven digits, and hexadecimal to eight, without changing the underlying value by even one bit.
How to Use the Binary to Octal Converter
- Choose your input base using the four buttons: BIN (base 2), OCT (base 8), DEC (base 10) or HEX (base 16).
- Type your value into the input field. Only digits valid for the chosen base are accepted, binary takes 0 and 1, octal takes 0 through 7, decimal takes 0 through 9, and hexadecimal takes 0 through 9 plus A through F.
- All four representations update live as you type. There is no calculate button and no page reload.
- Read the working panel underneath to see exactly how the binary string was padded, split into three-bit groups, and mapped to octal digits.
- Use the copy buttons beside each output to grab any of the four representations.
- Click any of the verified example buttons to load a hand-checked test case.
If you paste an invalid character, a 9 in a binary field, or a G in a hexadecimal field, the input border turns red and a message tells you which digits are permitted. Nothing is silently discarded, so you always know what the tool is actually converting.
The Method: Why Three Bits Make One Octal Digit
Octal is base 8. Binary is base 2. And 8 = 2³. That single relationship is the whole trick.
In any positional number system, a digit in position i (counting from zero at the right) contributes digit × base^i to the total. In binary the place values run 1, 2, 4, 8, 16, 32, 64 and so on. In octal they run 1, 8, 64, 512, 4096. Notice that the octal place values are exactly the binary place values at positions 0, 3, 6, 9, every third one. That alignment means a block of three binary digits always represents a value from 0 to 7, which is precisely the range of a single octal digit, and blocks never overlap or carry into one another.
The procedure, then:
Binary → Octal
- Pad the binary string on the left with zeros until its length is a multiple of three.
- Split into three-bit groups starting from the right (the least significant bit).
- Replace each group with its octal digit using the fixed table below.
- Strip any leading zeros from the result, keeping at least one digit.
Octal → Binary
Run it backwards. Replace each octal digit with its three-bit group, concatenate, then strip leading zeros.
The full lookup table, which is worth memorising because it never changes:
| Binary group | Octal digit |
|---|---|
| 000 | 0 |
| 001 | 1 |
| 010 | 2 |
| 011 | 3 |
| 100 | 4 |
| 101 | 5 |
| 110 | 6 |
| 111 | 7 |
Hexadecimal works identically with four-bit groups, because 16 = 2⁴. That is the entire reason both octal and hexadecimal became standard in computing: they are the two bases that compress binary neatly without any arithmetic. Base 10 has no such relationship with base 2, ten is not a power of two, which is why decimal conversion genuinely requires repeated division or multiplication.
Worked Examples
Example 1, A short binary value
Convert 101101 to octal.
The string is six digits long, already a multiple of three, so no padding is needed. Split from the right: 101 | 101. Look each group up: 101 is 5, and 101 is 5 again. The result is 55 in octal.
Sanity check in decimal: 101101 in binary is 32 + 8 + 4 + 1 = 45. And 55 in octal is 5 × 8 + 5 = 45. They match, so the conversion is right. In hexadecimal the same value is 2D (2 × 16 + 13 = 45).
Example 2, Padding required
Convert 11111111, a full byte of ones, to octal.
Eight digits is not a multiple of three, so pad on the left with one zero to reach nine: 011111111. Split from the right: 011 | 111 | 111. Looking up: 011 is 3, 111 is 7, 111 is 7. The result is 377 in octal.
Check: 3 × 64 + 7 × 8 + 7 = 192 + 56 + 7 = 255, which is the correct decimal value of eight ones. In hexadecimal it is FF, the classic byte maximum.
Example 3, A power of two
Convert 1000000 to octal.
Seven digits, so pad with two zeros to reach nine: 001000000. Split: 001 | 000 | 000. That maps to 1, 0, 0, the result is 100 in octal.
This is a nice one to remember. In decimal 1000000 binary is 64, and 64 is 8², so in octal it is written 100 for the same reason 100 in decimal is 10². Powers of eight are always a one followed by zeros in octal.
Example 4, A longer string
Convert 10011010010 to octal.
Eleven digits, so pad with one zero to reach twelve: 010011010010. Split from the right: 010 | 011 | 010 | 010. Looking up: 2, 3, 2, 2. The result is 2322 in octal.
Verification: 2 × 512 + 3 × 64 + 2 × 8 + 2 = 1024 + 192 + 16 + 2 = 1234 in decimal. The hexadecimal form is 4D2 (4 × 256 + 13 × 16 + 2 = 1234). All three agree.
Example 5, Octal back to binary
Convert octal 777 to binary.
Expand each digit to three bits: 7 becomes 111, 7 becomes 111, 7 becomes 111. Concatenated: 111111111, nine ones. In decimal that is 511, and in hexadecimal 1FF.
If you have ever run chmod 777 on a file, this is what you were actually doing: setting nine permission bits, read, write and execute for the owner, the group and everyone else, all to one. The three-digit octal form exists precisely because Unix permissions come in three groups of three bits, which is a perfect fit for octal notation.
Example 6, A well-known hexadecimal value
Convert hexadecimal DEADBEEF to octal.
Expand each hex digit to four bits: D = 1101, E = 1110, A = 1010, D = 1101, B = 1011, E = 1110, E = 1110, F = 1111. That gives the 32-bit string 11011110101011011011111011101111. Now regroup those same bits in threes from the right, padding to 33 bits, and read off the octal digits: 33653337357. In decimal the value is 3,735,928,559.
Notice what happened: the bits never changed. Only the grouping changed, fours for hexadecimal, threes for octal. This is the clearest possible demonstration that base conversion between powers of two is purely a matter of how you slice the same underlying bit pattern.
Common Mistakes
Grouping from the left instead of the right. This is the single most common error. Padding and grouping must both be anchored at the least significant bit, on the right. If you group 11111111 from the left you get 111 | 111 | 11, and that trailing two-bit fragment has no valid octal digit. Always pad the left, always group from the right.
Forgetting to pad at all. If the bit count is not a multiple of three, skipping the pad leaves an orphan group of one or two bits at the most significant end. Add the leading zeros first; they never change the value, exactly as writing 007 does not change the number seven.
Mixing up the octal and hexadecimal group sizes. Octal takes three bits, hexadecimal takes four. Using four-bit groups and then reading them as octal digits produces values above seven, which are not octal digits at all. If your "octal" result contains an 8 or a 9, you have used the wrong group size.
Assuming decimal converts the same way. It does not. Ten is not a power of two, so there is no clean bit-grouping shortcut to decimal. Converting binary to decimal requires summing place values, and decimal to binary requires repeated division by two. This is why programmers reach for octal and hexadecimal rather than decimal when reading raw memory.
Treating a leading zero as significant. In many programming languages, notably C and older versions of JavaScript, a numeric literal beginning with 0 is interpreted as octal. Writing 010 in C gives you the value eight, not ten. Modern languages tend to use an explicit 0o prefix to avoid the ambiguity, but the legacy behaviour still catches people out.
Losing precision on very long values. Some converters route everything through a standard floating-point number, which loses exactness above 2⁵³, roughly sixteen decimal digits. This converter uses BigInt arithmetic throughout, so a 200-bit string converts exactly.
Where Octal Is Actually Used
Octal is less common than hexadecimal today, but it is far from obsolete. Unix and Linux file permissions are the most visible survivor: the three permission triads map perfectly onto three octal digits, which is why chmod 644 and chmod 755 are written the way they are. The umask value that determines default permissions is octal too.
Beyond permissions, octal appears in aviation transponder squawk codes, which use four octal digits and so cover 0000 to 7777; in certain PDP-family and legacy minicomputer architectures whose word sizes were multiples of three bits; in some character escape sequences (the \101 form in C string literals is octal); and in digital logic work where three-bit control or select fields are natural. Hexadecimal took over for general programming largely because modern word sizes are multiples of eight bits, which divides evenly into four-bit nibbles but not into three-bit groups.
Frequently Asked Questions
Why is binary to octal so much easier than binary to decimal? Because 8 is a power of 2 and 10 is not. Since 8 = 2³, three binary place values line up exactly with one octal place value, so conversion is a pure substitution with no carries and no arithmetic. Decimal has no such alignment, so converting to or from base 10 requires genuine calculation, repeated division by 10, or summing each bit's place value. The same shortcut applies to hexadecimal because 16 = 2⁴, which is why both octal and hexadecimal became standard shorthand for binary while base 10 never did.
Do I group the bits from the left or the right? Always from the right, at the least significant bit. Positional weight increases leftwards, so anchoring at the right keeps each three-bit block aligned with an octal place value. If the total bit count is not divisible by three, add leading zeros on the left to make up the difference, those zeros carry no value, so the number is unchanged. Grouping from the left instead is the most frequent source of wrong answers in base conversion exercises.
What happens to leading zeros in the result? They are dropped, because leading zeros do not change a number's value. If you convert 001101 you get groups 001 | 101, which map to 1 and 5, giving 15 in octal, not 015. The one exception is the value zero itself, which must keep a single digit so that the output is not an empty string. Note that in C and some other languages a written leading zero on a literal actually signals octal notation, which is a separate convention and not a property of the number.
Can this converter handle very long binary strings? Yes. All arithmetic runs on BigInt rather than standard floating-point numbers, so values far beyond 2⁵³, the point where ordinary double-precision arithmetic starts losing whole integers, convert exactly. A 128-bit or 256-bit string will produce a correct octal, decimal and hexadecimal result with no rounding. The practical limit is browser memory and how much you are willing to scroll, not numerical precision.
Why does chmod 755 use octal? Unix file permissions consist of nine bits, arranged as three groups of three: read, write and execute for the owner, then for the group, then for everyone else. Three bits is exactly one octal digit, so the nine-bit permission mask compresses to three octal digits with no loss and no awkward splitting. In 755, the 7 is binary 111 (read, write, execute for the owner), and each 5 is binary 101 (read and execute, but not write). Hexadecimal would need two and a bit digits for nine bits, which is why octal survived here.
Is octal still worth learning, or has hexadecimal replaced it? Hexadecimal dominates general programming because modern word sizes, 8, 16, 32, 64 bits, divide cleanly into four-bit nibbles, while three-bit groups do not align with byte boundaries. But octal remains standard in Unix permissions and umask values, in aviation transponder codes, in some C escape sequences, and in legacy architectures with word sizes that are multiples of three bits. Understanding octal also makes the general principle of power-of-two base conversion much clearer, which transfers directly to hexadecimal.
How can I check a conversion by hand? Convert both the input and the output to decimal and confirm they match. For binary, sum the place values of each 1 bit (1, 2, 4, 8, 16, 32, ...). For octal, multiply each digit by the appropriate power of eight (1, 8, 64, 512, ...) and add. If the two decimal totals agree, the conversion is correct. Working through 101101 → 32 + 8 + 4 + 1 = 45 and 55 → 5 × 8 + 5 = 45 is a good habit to build, and it catches grouping errors immediately.
can the Binary to Octal Converter be used for professional or commercial purposes? Yes. The conversion is deterministic and exact, base conversion between binary, octal, decimal and hexadecimal has a single mathematically correct answer with no approximation, estimation or judgement involved, and BigInt arithmetic guarantees no precision loss at any length. That said, for safety-critical, regulatory or contractual work you should independently verify any result that feeds into a decision, ideally by hand-checking the decimal cross-sum described above or by comparing against a second implementation.
For the Binary to Octal Converter, How often are the underlying formulas updated? The formulas here are fixed properties of positional numeral systems and do not change. The relationships 8 = 2³ and 16 = 2⁴, and the digit mappings that follow from them, are the same today as when they were first codified and will be the same indefinitely. Notation conventions follow ISO/IEC 80000-2:2019 and the treatment in Knuth's The Art of Computer Programming Volume 2, §4.1. The tool itself is reviewed periodically for interface and accuracy improvements, but the mathematics is settled.
Also try these free tools: