Google Sheets OCT2BIN Function: Convert Octal to Binary

How-to basics · Updated November 23, 2026

The OCT2BIN function in Google Sheets converts a signed octal number (base 8) into a signed binary number (base 2). Its syntax is OCT2BIN(signed_octal_number, [significant_digits]), where the first argument is required and the second optional.

What Is OCT2BIN Used For?

OCT2BIN is part of Google Sheets’ Engineering functions, a set of tools designed for technical, scientific, and data-conversion tasks. It is most useful when you work with digital logic, computer architecture, or low-level programming, where octal (base-8) and binary (base-2) representations appear frequently. For example, Unix file permissions are often shown in octal (like 755), and converting them to binary can help you understand the read/write/execute bits for each user class.

The function belongs to a family of base-conversion functions in Sheets, including BIN2OCT, OCT2DEC, DEC2BIN, HEX2BIN, and others. Knowing OCT2BIN is useful if you regularly switch between number systems in spreadsheets, especially for teaching, engineering logs, or data analysis involving bitmasks.

How OCT2BIN Works

OCT2BIN interprets the input as a signed octal number. In computing, signed numbers use a fixed number of bits, and the leftmost bit indicates sign (0 for positive, 1 for negative). The function returns a binary string that respects this signed interpretation.

Key behavior:

  • The octal input must be a valid string or number. If you enter a plain number like 10, Sheets treats it as octal (not decimal).
  • If the octal number is positive, the output binary has no leading zeros unless you specify significant_digits.
  • If the octal number is negative, the output is represented in two’s-complement form using 10 bits (the standard for this function).
  • The optional significant_digits parameter pads the result with leading zeros to the specified length. It only works for positive numbers; for negative numbers, it is ignored.

Syntax and Arguments Explained

The full syntax is:

OCT2BIN(signed_octal_number, [significant_digits])

Here is what each argument means:

  • signed_octal_number (required) – The octal number you want to convert. It can be a cell reference, a number, or a text string. The valid range is from 7777777777 (which equals -1 in decimal) to 7777777777? Actually, the function accepts octal values that correspond to signed 10-bit binary, meaning the decimal range is -512 to 511. In octal, that is from 7777777777 (representing -1) to 777 (representing 511). In practice, you can enter any octal string up to 10 digits, but values outside the valid range produce an error.
  • significant_digits (optional) – The minimum number of digits in the result. If the result would have fewer digits, leading zeros are added. If you specify more than 10 digits, or if the number is negative, the function returns an error or ignores the argument.

Concrete Examples with Formulas

Let’s see OCT2BIN in action. Assume you have octal values in cells A2:A5.

With A2 = 10 (octal 8 in decimal):

=OCT2BIN(A2)

Returns 1000.

With A3 = 777 (octal 511 in decimal):

=OCT2BIN(A3)

Returns 111111111 (9 ones, because 511 in binary is 111111111).

With A4 = 7777777777 (octal for -1 in signed 10-bit):

=OCT2BIN(A4)

Returns 1111111111 (10 ones, which is the two’s-complement representation of -1).

Using the optional significant digits, with A5 = 5 (octal 5):

=OCT2BIN(A5, 8)

Returns 00000101 (padded to 8 bits).

Common Errors and How to Fix Them

OCT2BIN can return errors if the input is invalid. Here are the most frequent issues:

  • #NUM! – The octal number is outside the valid range (less than -512 or greater than 511 in decimal). For example, =OCT2BIN(1000) returns #NUM! because octal 1000 equals 512 decimal, which is too large for a signed 10-bit result.
  • #VALUE! – The input contains non-octal characters (like 8 or 9). For instance, =OCT2BIN("18") returns #VALUE! because 8 is not a valid octal digit.
  • #NUM! with significant_digits – If you specify more than 10 significant digits, or if the significant_digits would make the result exceed 10 bits, you get #NUM!. For example, =OCT2BIN(5, 11) returns #NUM!.

To avoid these, ensure your octal strings contain only digits 0-7 and stay within the accepted decimal range. If you need to convert larger numbers, consider using OCT2DEC first and then a custom formula, or use DEC2BIN with careful handling.

OCT2BIN vs. Other Base Conversion Functions

Google Sheets offers a full set of base converters. Here’s how OCT2BIN compares:

  • BIN2OCT – Does the reverse: converts binary to octal. Useful when you have bit patterns and want compact octal representation.
  • OCT2DEC – Converts octal to decimal. If you want to see the numeric value in a familiar base, use this first.
  • DEC2BIN – Converts decimal to binary. If you start with a decimal number, you could use DEC2BIN directly, but OCT2BIN is for when your source is already octal.
  • HEX2BIN – Converts hexadecimal to binary. Similar syntax and constraints, but for base-16 input.

All these functions share the same signed 10-bit limit for binary output. That means they work best for numbers between -512 and 511 decimal. For larger values, you’ll need to split the conversion or use a custom script.

Practical Use Cases and Tips

OCT2BIN is not a daily tool for most spreadsheet users, but it shines in specific scenarios:

  • Unix permissions – Convert octal permission codes (like 644 or 755) to binary to see the individual read/write/execute bits.
  • Bitmask analysis – When debugging network masks or flag values stored in octal, converting to binary reveals which bits are set.
  • Education – Teachers and students can use it to verify manual conversions or generate practice problems.

One tip: If you need to convert many values, use an array formula. For example, with octal values in A2:A100, you can put =ARRAYFORMULA(OCT2BIN(A2:A100)) in B2 to get all results at once. However, note that ARRAYFORMULA with OCT2BIN may not work if the function does not support array inputs in your version; test it first. In current Google Sheets, it does work.

Frequently Asked Questions

Can OCT2BIN convert negative octal numbers?

Yes, it handles negative octal numbers by returning the two’s-complement binary representation using 10 bits. For example, =OCT2BIN("7777777777") returns 1111111111, which is -1 in signed 10-bit binary.

What is the maximum octal number I can convert?

The maximum positive octal number is 777, which equals 511 in decimal. Any larger value (like 1000) will return a #NUM! error because it exceeds the 10-bit signed range.

Why does OCT2BIN return a #VALUE! error for “18”?

Because 8 is not a valid octal digit. Octal numbers only use digits 0 through 7. The function expects a string that contains only those digits, otherwise it cannot interpret the input.

Does the significant_digits argument work for negative numbers?

No, it is ignored for negative numbers. The function always returns the full 10-bit two’s-complement representation for negatives, regardless of the significant_digits value.

Is OCT2BIN available in Excel?

Yes, Excel has an OCT2BIN function with the same syntax and behavior. However, in Excel, the function is under the Engineering category and may require the Analysis ToolPak in older versions, though it is built-in in modern Excel 365.

Can I convert octal numbers larger than 511 by splitting them?

Yes, you can split the octal number into two parts, convert each part to binary, and then concatenate the results. For example, to convert octal 1000 (512 decimal), you could convert 1 and 000 separately and combine, but you must handle the sign and bit-length carefully. A simpler approach is to use OCT2DEC to get the decimal value and then use a custom formula to convert to binary with more bits.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.