Converts a binary number to hexadecimal.

Sample Usage



BIN2HEX(number, [places])

  • number - The binary number to be converted.
  • places - [OPTIONAL] The number of places in the output.


BIN2HEX(1100) returns a value of c.
BIN2HEX(1100,3) returns a value of 00c.
BIN2HEX(C5) converts the binary number contained in C5 to hexadecimal.


  • If number is negative, the value of places is ignored and BIN2HEX returns a 10-character hexadecimal number. 
  • number cannot contain more than 10 characters.
  • If number is not a valid binary number, BIN2HEX returns the #NUM! error value.
  • If places is not an integer, it is truncated.
  • If places is non-numeric, BIN2HEX returns the #VALUE! error value.
  • If places is negative, BIN2HEX returns the #NUM! error value.
  • If the number of digits required is greater than the specified places, the #NUM! error is returned.