BIN2HEX Function in Google Sheets

Convert a binary number to a hexadecimal number using the BIN2HEX function.

BIN2HEX Function

The BIN2HEX function in Google Sheets converts a signed binary number to a hexadecimal number.

Syntax

BIN2HEX(signed_binary_number, [significant_digits])
  • signed_binary_number: The binary number to be converted.
  • significant_digits (optional): The number of digits to return.

Examples

  1. Basic Conversion

To convert the binary number 1010 to hexadecimal:

=BIN2HEX("1010")
  1. Specifying Significant Digits

To convert 1010 to a hexadecimal with 4 significant digits:

=BIN2HEX("1010", 4)

Notes

  • The significant_digits parameter pads the result with leading zeros if necessary.
  • Supports both positive and negative binary numbers.
  • DEC2HEX: Converts a decimal number to a hexadecimal number.
  • BIN2DEC: Converts a binary number to a decimal number.