Calc HEX2BIN function

The HEX2BIN function converts a hexadecimal number to its binary equivalent.

Help CentreFunctions & Formulas

For a full list of available calculation functions, please read What calculation functions are supported.


Description

The HEX2BIN function converts a hexadecimal number to its binary equivalent. This is useful in various applications, especially in computing and digital electronics, where binary representation is essential.


Syntax

HEX2BIN(number, [places])


The HEX2BIN function syntax has the following arguments:

  • number Required. The hexadecimal number you want to convert to binary. It must be a valid hexadecimal string.
  • places Optional. The number of characters to use for the binary result. If omitted, the function returns the minimum number of characters necessary to represent the number in binary.

Example

FormulaDescriptionResult
=HEX2BIN("A")Converts the hexadecimal number "A" to binary.1010
=HEX2BIN("FF")Converts the hexadecimal number "FF" to binary.11111111
=HEX2BIN("-1")Converts the hexadecimal number "-1" to binary (two's complement representation).11111111111111111111111111111111
=HEX2BIN("A", 8)Converts the hexadecimal number "A" to binary with at least 8 characters.00001010

Errors

For a full list of formula errors, please read Formula errors.


Related functions

See it working on your own data

Everything documented here ships with the platform – try the document tools free, or go live in 7 days.