BASE Function
Converts a number to text in another base, such as binary or hexadecimal.
Category
Math & Trig
Available in
Excel 2013+, Microsoft 365
Returns
Text
Want to practice BASE in a real spreadsheet? Open a blank sheet in our Practice Sandbox and try it with live data, with the AI Excel tutor beside you. No Excel needed — just a free account.Try it free in the Sandbox
Overview
BASE writes a number in any base from 2 to 36: binary (2), octal (8), hexadecimal (16) and more.
Set a minimum length to pad the result with zeros.
Syntax
=BASE(number, radix, [min_length])
Arguments
| Argument | Required? | What it does |
|---|---|---|
| number | Yes | A whole number zero or above. |
| radix | Yes | The base, from 2 to 36. |
| min_length | Optional | Pad with leading zeros to at least this length. |
Examples
Example 1 — Binary flags
Show permission codes as 8-digit binary.
B2fx=BASE(A2, 2, 8)
| A | B | |
|---|---|---|
| 1 | Code | Binary |
| 2 | 5 | 00000101 |
| 3 | 12 | 00001100 |
| 4 | 255 | 11111111 |
=BASE(A2, 2, 8) Explain
Common mistakes
- Text, not a number. The result is text. Use DECIMAL to convert back.
Notes
- Related functions: DECIMAL, DEC2BIN, DEC2HEX.

Author
Kyle Stott
Certified Microsoft Excel Expert
Kyle has worked professionally with Microsoft Excel for over a decade and has consulted on and taught Excel best practices to over 400 companies across 30+ countries.