Skip to content

bin2hex

Convert a binary string to a hexadecimal string.

v = bin2hex(b, p)

Returns the hex representation of binary string b. Optional p zero-pads to that minimum length.

bin2hex('11111011') % 'FB'
bin2hex('1010', 4) % '000A'
  • bin2dec — Convert a binary string to a decimal number.
  • bin2oct — Convert a binary string to an octal string.