Return
to tool
Numbers & Bases

Convert Binary to Octal

Convert binary to octal the way the maths actually works: group the bits into threes from the right, then read each group as a single octal digit. The converter below does it live in both directions, shows the grouping as you type, and handles binary fractions — bits after the point — which most tools quietly refuse. Further down you'll find worked examples for the numbers people search for, and a chmod chart, because Unix file permissions are octal for exactly this reason.

Binary ↔ Octal

Type in either field. The other updates live, with the 3-bit grouping drawn below.

Accepts up to 64 bits before the point and 24 after. Spaces and underscores are fine.

Why binary groups into threes

Octal is base 8, and 8 is 2 to the third power. That single fact is the whole method. Because three binary digits produce exactly eight possible patterns — 000 through 111 — and octal has exactly eight digits, every 3-bit group maps to one octal digit with nothing left over and no arithmetic required.

This is why converting binary to octal never involves division, unlike converting binary to decimal. Ten is not a power of two, so decimal conversion means real calculation. Eight is, so octal conversion is substitution: chop the bits into threes, look each group up, write the digit down. The same relationship gives hexadecimal its four-bit groups, since 16 is 2 to the fourth.

3-bit groupOctal digitDecimal value
00000
00111
01022
01133
10044
10155
11066
11177

How to convert binary to octal, step by step

  1. Start from the rightmost bit — the one furthest from the point, not the leftmost.
  2. Split the binary digits into groups of three, working right to left.
  3. If the leftmost group ends up short, pad it on the left with zeros until it has three digits. Leading zeros never change a number's value.
  4. Convert each 3-bit group to its octal digit using the table above.
  5. Write the digits in the same left-to-right order as their groups. That is your octal number.

The direction matters. Grouping from the left instead of the right is the single most common error, and it produces a wrong answer whenever the bit count is not already a multiple of three. Binary 1111 grouped from the left gives 111 and 1, which reads as 71 — but grouped correctly from the right it gives 001 and 111, which is 17. The correct answer is 17, and you can check it: 1111 in binary is 15, and 17 in octal is 8 + 7 = 15.

Worked examples

Convert 10101 binary to octal

10101 has five bits, which is not a multiple of three, so pad it on the left with one zero to make 010101. Split from the right into 010 and 101. From the lookup table, 010 is 2 and 101 is 5. So 10101 in binary is 25 in octal. Check it against decimal: 10101 binary is 21, and 25 octal is (2 x 8) + 5 = 21.

StageValue
Original binary10101
Padded to a multiple of 3010101
Split into groups from the right010 | 101
Each group as an octal digit2 | 5
Result25 octal
Decimal check21

Convert 1111 binary to octal

1111 has four bits, so pad on the left with two zeros to make 001111. Split from the right into 001 and 111. That gives 1 and 7, so 1111 in binary is 17 in octal. Decimal check: 1111 binary is 15, and 17 octal is 8 + 7 = 15. This example is worth doing by hand because two padding zeros are needed, which is where people most often slip into grouping from the wrong end.

StageValue
Original binary1111
Padded to a multiple of 3001111
Split into groups from the right001 | 111
Each group as an octal digit1 | 7
Result17 octal
Decimal check15

Convert 11111111 binary to octal

Eight bits — one full byte, and the largest value a byte can hold. Pad to nine bits: 011111111. Split from the right into 011, 111, 111, giving 3, 7, 7. So 11111111 binary is 377 octal. Decimal check: 255, and 377 octal is (3 x 64) + (7 x 8) + 7 = 192 + 56 + 7 = 255. Every byte fits in three octal digits, and 377 is the ceiling — which is exactly why old Unix systems used three-digit octal for byte values.

Converting octal back to binary

The reverse is easier, because there is no padding decision to make. Replace each octal digit with its three binary digits, keeping the order, then drop any leading zeros from the final result. Octal 25 becomes 010 and 101, which reads 010101, which is 10101 once the leading zero is dropped.

The one rule people forget is that every digit expands to exactly three bits, including small ones. Octal 5 is 101, but in the middle of a number it must be written as the full 101, and octal 1 must be written 001, not just 1. Octal 41 is 100001, not 1001. Use the swap button on the converter above to go this direction without retyping anything.

OctalDigit-by-digit expansionBinary result
7111111
17001 1111111
25010 10110101
41100 001100001
65110 101110101
77111 111111111
100001 000 0001000000
144001 100 1001100100
200010 000 00010000000
377011 111 11111111111
644110 100 100110100100
755111 101 101111101101
1750001 111 101 0001111101000

Binary fractions and the point

Bits after a binary point convert to octal just as cleanly, but the padding direction flips. Before the point you pad on the left; after it you pad on the right. The reason is that place values radiate outward from the point in both directions, so the group nearest the point is always the one that must stay complete.

Take 0.11. There are two fractional bits, so pad on the right to 0.110, which is one group: 110, or octal 6. So 0.11 binary is 0.6 octal. Check it: 0.11 binary is a half plus a quarter, or 0.75, and 6/8 is also 0.75. Now take 101.101 — the integer part 101 is one complete group giving 5, and the fractional part 101 is one complete group giving 5, so the answer is 5.5 octal. Not one of the seven pages currently ranking for this term handles fractional input at all.

BinaryPaddedGroupsOctalDecimal check
0.10.1001000.40.5
0.110.1101100.60.75
0.1010.1011010.50.625
0.1110.1111110.70.875
0.00110.001100001 1000.140.1875
0.10110.101100101 1000.540.6875
0.0000010.000001000 0010.010.015625
1.11.100001 | 1001.41.5
10.01010.010010 | 0102.22.25
101.101101.101101 | 1015.55.625
110.11110.110110 | 1106.66.75
1101.11001101.110001 101 | 11015.613.75

Reference charts

Binary to octal quick reference

Common binary values with their octal, decimal and hexadecimal equivalents. The first eight rows are the ones to memorise — they are the 3-bit groups the whole method rests on.

BinaryOctalDecimalHex
00000000000000
00000001001101
00000010002202
00000011003303
00000100004404
00000101005505
00000110006606
00000111007707
00001000010808
00001001011909
00001010012100A
00001011013110B
00001100014120C
00001101015130D
00001110016140E
00001111017150F
000100000201610
000100010211711
000100100221812
000100110231913
000101000242014
000101010252115
000101100262216
000101110272317
000110000302418
000110010312519
00011010032261A
00011011033271B
00011100034281C
00011101035291D
00011110036301E
00011111037311F
001000000403220
001000010413321
001000100423422
001000110433523
001001000443624
001001010453725
001001100463826
001001110473927
001010000504028
001010010514129
00101010052422A
00101011053432B
00101100054442C
00101101055452D
00101110056462E
00101111057472F
001100000604830
001100010614931
001100100625032
001100110635133
001101000645234
001101010655335
001101100665436
001101110675537
001110000705638
001110010715739
00111010072583A
00111011073593B
00111100074603C
00111101075613D
00111110076623E
00111111077633F
010000001006440
010000011016541
010000101026642
010000111036743
010001001046844
010001011056945
010001101067046
010001111077147
010010001107248
010010011117349
01001010112744A
01001011113754B
01001100114764C
01001101115774D
01001110116784E
01001111117794F
010100001208050
010100011218151
010100101228252
010100111238353
010101001248454
010101011258555
010101101268656
010101111278757
010110001308858
010110011318959
01011010132905A
01011011133915B
01011100134925C
01011101135935D
01011110136945E
01011111137955F
011000001409660
011000011419761
011000101429862
011000111439963
0110010014410064
0110010114510165
0110011014610266
0110011114710367
0110100015010468
0110100115110569
011010101521066A
011010111531076B
011011001541086C
011011011551096D
011011101561106E
011011111571116F
0111000016011270
0111000116111371
0111001016211472
0111001116311573
0111010016411674
0111010116511775
0111011016611876
0111011116711977
0111100017012078
0111100117112179
011110101721227A
011110111731237B
011111001741247C
011111011751257D
011111101761267E
011111111771277F
1000000020012880
1000000120112981
1000001020213082
1000001120313183
1000010020413284
1000010120513385
1000011020613486
1000011120713587
1000100021013688
1000100121113789
100010102121388A
100010112131398B
100011002141408C
100011012151418D
100011102161428E
100011112171438F
1001000022014490
1001000122114591
1001001022214692
1001001122314793
1001010022414894
1001010122514995
1001011022615096
1001011122715197
1001100023015298
1001100123115399
100110102321549A
100110112331559B
100111002341569C
100111012351579D
100111102361589E
100111112371599F
10100000240160A0
10100001241161A1
10100010242162A2
10100011243163A3
10100100244164A4
10100101245165A5
10100110246166A6
10100111247167A7
10101000250168A8
10101001251169A9
10101010252170AA
10101011253171AB
10101100254172AC
10101101255173AD
10101110256174AE
10101111257175AF
10110000260176B0
10110001261177B1
10110010262178B2
10110011263179B3
10110100264180B4
10110101265181B5
10110110266182B6
10110111267183B7
10111000270184B8
10111001271185B9
10111010272186BA
10111011273187BB
10111100274188BC
10111101275189BD
10111110276190BE
10111111277191BF
11000000300192C0
11000001301193C1
11000010302194C2
11000011303195C3
11000100304196C4
11000101305197C5
11000110306198C6
11000111307199C7
11001000310200C8
11001001311201C9
11001010312202CA
11001011313203CB
11001100314204CC
11001101315205CD
11001110316206CE
11001111317207CF
11010000320208D0
11010001321209D1
11010010322210D2
11010011323211D3
11010100324212D4
11010101325213D5
11010110326214D6
11010111327215D7
11011000330216D8
11011001331217D9
11011010332218DA
11011011333219DB
11011100334220DC
11011101335221DD
11011110336222DE
11011111337223DF
11100000340224E0
11100001341225E1
11100010342226E2
11100011343227E3
11100100344228E4
11100101345229E5
11100110346230E6
11100111347231E7
11101000350232E8
11101001351233E9
11101010352234EA
11101011353235EB
11101100354236EC
11101101355237ED
11101110356238EE
11101111357239EF
11110000360240F0
11110001361241F1
11110010362242F2
11110011363243F3
11110100364244F4
11110101365245F5
11110110366246F6
11110111367247F7
11111000370248F8
11111001371249F9
11111010372250FA
11111011373251FB
11111100374252FC
11111101375253FD
11111110376254FE
11111111377255FF
100000000400256100
1111101007645001F4
10000000001000512200
1111101000175010003E8
1000000000020001024400
11111111111177774095FFF
10000000000001000040961000
111111111111111117777765535FFFF

Starting from a decimal number instead? The decimal to octal converter and the decimal to hex converter cover the division method.

Octal place values

Position (right to left)Place value8^nEquivalent bits
018^0bits 0-2
188^1bits 3-5
2648^2bits 6-8
35128^3bits 9-11
44,0968^4bits 12-14
532,7688^5bits 15-17
6262,1448^6bits 18-20
72,097,1528^7bits 21-23
816,777,2168^8bits 24-26

Where octal actually gets used: Unix file permissions

If you are not a computer science student, there is a good chance the only octal you will ever meet is a chmod command — and it is octal for precisely the reason this page is about. Unix permissions come in three groups of three bits: read, write and execute, for the owner, the group and everyone else. Nine bits, three groups of three, one octal digit per group. chmod 755 is not an arbitrary code; it is binary 111101101 written the short way.

Read that number through the grouping method and it decodes itself. 111 is 7, meaning read, write and execute all on. 101 is 5, meaning read and execute on, write off. So 755 is rwx for the owner, r-x for the group, r-x for everyone — the standard permission set for a directory or an executable script. Every chmod number you have ever copied off a forum post is a binary-to-octal conversion someone else already did.

Octal digitBinaryPermissionsMeaning
0000---No access
1001--xExecute only
2010-w-Write only
3011-wxWrite and execute
4100r--Read only
5101r-xRead and execute
6110rw-Read and write
7111rwxRead, write and execute
chmodBinarySymbolicTypical use
000000000000---------Locked, no access for anyone
400100000000r--------Owner-read-only archive file
444100100100r--r--r--Read-only for everyone
555101101101r-xr-xr-xRead and execute, no writes
600110000000rw-------Private file, e.g. an SSH key
604110000100rw----r--Owner edits, world reads
640110100000rw-r-----Owner edits, group reads
644110100100rw-r--r--Standard file default
660110110000rw-rw----Owner and group collaborate
664110110100rw-rw-r--Group edits, world reads
666110110110rw-rw-rw-World-writable file (rarely wise)
700111000000rwx------Private directory or script
711111001001rwx--x--xTraversable but not listable
750111101000rwxr-x---Owner runs, group runs
755111101101rwxr-xr-xStandard directory and script default
775111111101rwxrwxr-xGroup can write, world can run
777111111111rwxrwxrwxEverything for everyone (avoid)

The same three-bit logic shows up in a few other corners. File permission masks in umask are octal for the same reason, just inverted. Older Unix system calls and PDP-11 assembly used octal throughout because those machines had word sizes that divided neatly by three. And in C, Python and several other languages, a number written with a leading zero is still interpreted as octal — which is why 0755 and 755 mean different things in code, and why a stray leading zero in a config file can produce a genuinely baffling bug.

Who uses this and why

Computer science students

Base conversion is standard first-year material and it is nearly always assessed by hand, so getting the answer is less useful than seeing the method. The grouping visualiser shows the padding and the split explicitly, which is where marks are actually lost — grouping from the wrong end, or forgetting that a middle digit still needs all three bits.

Systems administrators and DevOps engineers

Reading and writing chmod values, umask settings and permission bits in Dockerfiles or Ansible playbooks. The chmod table above converts in both directions, so you can go from a symbolic string you have been handed to the number a script needs, or decode a number someone else wrote.

Embedded and hardware engineers

Some legacy architectures, instruction encodings and datasheet conventions are octal-native, particularly anything descended from PDP-era design. Register fields that split into three-bit chunks are far easier to read in octal than in hex, because the field boundaries line up with the digits.

Developers debugging permission and encoding bugs

A leading zero silently turning a decimal literal into octal is a classic source of wrong-value bugs in C, older JavaScript and Python 2 code. Being able to convert quickly in both directions is often the fastest way to confirm whether a number is being read as base 8 or base 10.

Frequently Asked Questions

How do you convert binary to octal?

Group the binary digits into threes starting from the right, padding the leftmost group with zeros if it is short, then replace each group with its octal digit. No division is needed because 8 equals 2 cubed, so each 3-bit group maps to exactly one octal digit.

How to convert 10101 binary to octal?

10101 in binary is 25 in octal. Pad it to six bits as 010101, split from the right into 010 and 101, then convert each group: 010 is 2 and 101 is 5. Checking in decimal, 10101 binary is 21 and 25 octal is 21.

How to convert 1111 binary to octal?

1111 in binary is 17 in octal. Pad it to six bits as 001111, split into 001 and 111, which give 1 and 7. In decimal both are 15, which confirms the answer.

How to convert octal to binary easily?

Replace each octal digit with its three binary digits and keep the order — 7 becomes 111, 5 becomes 101, and so on. Every digit expands to exactly three bits including small ones, so octal 41 becomes 100001, not 1001. Drop any leading zeros at the very end.

Why do you group binary digits in threes?

Because 8 is 2 to the third power, so three binary digits produce exactly eight patterns and octal has exactly eight digits. The mapping is one-to-one with nothing left over, which is why the conversion is substitution rather than arithmetic.

What if the binary number doesn't divide evenly into groups of three?

Pad the leftmost group with zeros until it has three digits. Leading zeros never change a number's value, so 1111 becomes 001111 and converts correctly. This is only true before the binary point — after it you pad on the right instead.

How do I convert a binary fraction to octal?

Split at the point and treat each side separately. Before the point, group in threes from the right and pad left; after the point, group in threes from the left and pad right. So 0.11 pads to 0.110, giving 0.6 octal.

What is chmod 755 in binary?

chmod 755 is binary 111101101. Each octal digit expands to three permission bits: 7 is 111 or rwx, and 5 is 101 or r-x. So 755 means read, write and execute for the owner, and read and execute for the group and everyone else.

What's the difference between octal and hexadecimal?

Octal is base 8 and groups binary in threes; hexadecimal is base 16 and groups it in fours. Hex is more common in modern computing because a byte is eight bits, which divides evenly into two hex digits but not into octal digits. Octal survives mainly in Unix file permissions.

Is octal still used today?

Yes, though in narrower places than it once was. Unix and Linux file permissions are its most common surviving use, along with umask values, some embedded architectures, and octal literals in several programming languages where a leading zero signals base 8.

Can I convert a negative binary number to octal?

Yes — the converter accepts a leading minus and applies it to the result, so -1111 binary gives -17 octal. Note this is sign-and-magnitude, not two's complement; if you are reading a negative value out of a fixed-width register, convert the two's complement pattern as an unsigned number instead.

Mini About Us

We built the Convert Binary to Octal page because every competing tool returns an answer without showing the 3-bit grouping that produces it, and none of them touch chmod, the one place octal still earns its keep. This one draws the groups live and decodes permission numbers too. This site is a part of the ads4good Network.

Read more about Utility Commons here