Convert a whole base-2 integer into base-8 octal instantly in your browser. Every three binary bits map to one octal digit, with exact BigInt precision for long values.
→
Runs locally
6 charactersWhole numbers · exact precision
Ready
Exact integer resultBase 8
Tip: enter a whole number in the selected input base.
Your data stays in your browser Free. No sign-up. Exact integer conversion
01 / EXPLAINED SIMPLY
How to convert binary to octal by hand
Because 8 equals 2³, every group of three binary bits maps cleanly to a single octal digit from 0 through 7. Start from the rightmost bit, split the binary number into groups of three, and pad the leftmost group with leading zeros if it has fewer than three bits.
For example, take 111101101. Split into three-bit groups from the right: 111, 101, and 101. Those map to 7, 5, and 5, giving the octal value 755 — the classic Unix file permission mask rwxr-xr-x.
Three-bit binary to octal chart
Binary (3 bits)
Octal digit
Decimal value
000
0
0
001
1
1
010
2
2
011
3
3
100
4
4
101
5
5
110
6
6
111
7
7
Unix 755 mask
111, 101, and 101 map to 7, 5, and 5 (rwxr-xr-x).
111101101
Optional 0b prefix
Both 101010 and 0b101010 convert to 52.
0b101010
8-bit byte
Leftmost 11 pads to 011 (3), giving octal 377.
11111111
02 / CONVERSION EXAMPLES
Binary to octal examples
Use these tested values to check grouping, optional 0b prefixes, negative integers, and exact BigInt arithmetic above JavaScript's safe integer limit. Click Try ↑ on any row to load it straight into the converter.
Binary inputs, octal outputs, and decimal equivalents
Binary input
Octal output
Decimal
Notes
101010
52
42
Two 3-bit groups: 101 (5) and 010 (2).
111101101
755
493
Unix rwxr-xr-x permission bits.
110100100
644
420
Unix rw-r--r-- file permission bits.
11111111
377
255
Leftmost group 11 pads to 011 (3).
-101010
-52
-42
Leading minus sign is preserved without fixed-width two's complement.
54-bit integer converted with exact BigInt precision.
Need the reverse direction? Open Octal to Binary. Working with 8-bit encoded text instead of one integer? Use Binary to Text.
GOOD QUESTIONS
Frequently asked questions
Quick answers on binary-to-octal grouping and input rules.
How do I group binary digits into octal when the length is not a multiple of 3?+
Always group from right to left and pad the leftmost group with leading zeros. For example, 11111111 (8 bits) splits into 011, 111, and 111, which converts to 377 in octal.
Does the converter accept a 0b prefix?+
Yes. Both 101010 and 0b101010 are accepted when Binary (2) is selected as the input base, and both output 52.
Why are spaces inside a binary number rejected here?+
Number mode converts one whole integer at a time using exact BigInt arithmetic. Remove display spaces for a single integer, or use Binary to Text if the spaces separate encoded character bytes.
Can I convert large 64-bit or 128-bit binary numbers to octal?+
Yes. The converter parses up to 4,096 binary digits directly as a BigInt, so it never rounds values above 2⁵³.