Quick Navigation
HEX2BIN Function
Summary
The Excel HEX2BIN function converts hexadecimal numbers to their binary representation. It handles both positive and negative numbers using two's-complement notation, making it essential for binary data analysis and low-level programming tasks.
Syntax
HEX2BIN(number, [places])
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| number | String |
Yes | Hexadecimal number to convert (max 10 characters). Uses two's-complement for negatives. |
| places | Integer |
No | Number of binary characters to return. Omitting uses minimum needed; useful for zero-padding. |
Using the HEX2BIN Function
HEX2BIN is perfect for converting hexadecimal values from hardware specs, memory dumps, or binary calculations into readable binary format. Use it when working with bitmasks, flags, or embedded systems data where hex-to-binary conversion is needed.
Common HEX2BIN Examples
Basic Padding Example
=HEX2BIN("F", 8)
Converts hex F to 8-bit binary with leading zero padding.
Simple Hex Conversion
=HEX2BIN("B7")
Converts hex B7 to its binary equivalent without padding.
Maximum Positive Value
=HEX2BIN("FFFFFFFFFF")
Converts largest 10-bit positive hex to full binary.
Frequently Asked Questions
Common Errors and Solutions
#NUM!
Cause: Invalid hex number, out-of-range value, or places too small
Solution: Verify hex format, ensure positive ≤1FF, negative ≥FFFFFFFE00, and sufficient places
#VALUE!
Cause: Places argument is non-numeric
Solution: Use integer for places parameter
Notes
- Max 10 hex characters
- Negative: ignores places, returns 10 chars
- Positive range: 0 to 1FF hex
- Negative range: FFFFFFFE00 to FFFFFFFFFF hex
- Places truncated to integer if decimal
Compatibility
Available in: Excel 2007, Excel 2010, Excel 2013, Excel 2016, Excel 2019, Excel 2021, Microsoft 365
Not available in: Excel 2003 and earlier
Content last reviewed: December 9, 2025
Update frequency: As needed
Excel versions tested: Excel 2007+