# BIN2HEX Function

> Convert a binary number to a hexadecimal number with BIN2HEX in TX Sheet Control: padding with places, two's complement negative numbers and #NUM! errors.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Function
- **Path:** TX Sheet Control > API Reference > Formula Functions > BIN2HEX Function
- **218 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/bin2hex/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/bin2hex/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/bin2hex/llms-full.txt

---

Convert a binary number to a hexadecimal number. `number` has at most 10 binary digits, and 10 digits starting with 1 are a negative number in two's complement, which returns 10 hexadecimal characters (`FFFFFFFFFF` for -1). `places` pads a positive result with leading zeros to that many characters; it is ignored for negative numbers. A `places` of 0 or less, or an invalid binary number, returns `#NUM!`.

### Syntax

```text
BIN2HEX(number, places)
```

Category: Engineering. Minimum arguments: 1. Maximum arguments: 2.

Available for supported offline calculation.

### Examples

```text
=BIN2HEX(10)
```

The formula returns `2`.

Cell and range examples require appropriate input values in the referenced cells. Handle invalid arguments, formula errors and array and spill constraints.

### See Also

- [Formulas](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/formulas/llms-full.txt)
- [Custom Functions and Formula Data](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/custom-functions/llms-full.txt)

---

## Nearby

- **Previous:** [BIN2DEC Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/bin2dec/llms-full.txt)
- **Next:** [BIN2OCT Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/bin2oct/llms-full.txt)
