DEC2BIN Function in Google Sheets

Convert a decimal number to a binary number using the DEC2BIN function.

DEC2BIN Function

The DEC2BIN function in Google Sheets is used to convert a decimal number to its binary equivalent.

Syntax

DEC2BIN(decimal_number, [significant_digits])
  • decimal_number: The decimal number you want to convert. This is a required parameter.
  • significant_digits: (Optional) The number of digits you want the binary number to contain.

Examples

  1. Basic Conversion

Convert the decimal number 10 to binary:

=DEC2BIN(10)

This will output 1010.

  1. Conversion with Significant Digits

Convert the decimal number 5 to binary with 6 significant digits:

=DEC2BIN(5, 6)

This will output 000101.

Notes

  • The function can handle decimal numbers from -512 to 511.
  • If significant_digits is provided, the binary result will be padded with leading zeros to match the specified length.
  • DEC2HEX: Convert a decimal number to a hexadecimal number.
  • DEC2OCT: Convert a decimal number to an octal number.