Engineering

BIN2HEX Function in Excel

Converts a binary number to hexadecimal.

Syntax

  • =BIN2HEX(number, [places])

Arguments

  • number (required): Binary number
  • places (optional): Number of characters to use

Examples

  • =BIN2HEX(11111011, 4) - Binary to hex - Result: 00FB

BIN2HEX in technical sheets

  • Document units in adjacent cells — many engineering functions require exact unit strings.
  • Use [CONVERT](/functions/convert/) for unit changes before specialized formulas.
  • Validate inputs with [ISNUMBER](/functions/isnumber/) and range checks.

Common errors

  • #NUM! if not valid binary

Use cases

  • Number conversion
  • Programming
  • Color codes

Frequently asked questions

  • What is BIN2HEX used for? BIN2HEX converts binary (base 2) to hexadecimal (base 16). =BIN2HEX(11111111) returns 'FF'. Useful for programming, working with memory addresses, color codes, and any situation where hex is more readable than binary.
  • How do I convert binary to hex color codes? Split RGB into 8-bit binary values, convert each with BIN2HEX. For red=255, green=128, blue=0: =BIN2HEX(11111111,2)&BIN2HEX(10000000,2)&BIN2HEX(0,2) gives 'FF8000' (orange).
  • What is the maximum binary value BIN2HEX accepts? BIN2HEX accepts up to 10 binary digits (1111111111 = 1023 decimal = 3FF hex). For larger values, convert to decimal first with BIN2DEC, then use DEC2HEX. Negative binary uses two's complement.

Editorial review

  • Reviewed by Excel.Directory Editorial Team. Updated May 2026.