The Excel BASE function converts a number into a text representation in a given radix (base), from binary (base 2) all the way up to base 36 — with optional zero-padding to a minimum length.
Syntax
| Argument | Description | |
|---|---|---|
number | Required | The number you want to convert. Must be a non-negative integer less than 2^53. |
radix | Required | The base to convert to, an integer from 2 to 36. |
min_length | Optional | Minimum length of the returned text. If the result is shorter, BASE pads it with leading zeros. |
How to use it
BASE turns a regular (base 10) number into text written in another base. The radix can be anything from 2 to 36 — digits beyond 9 use the letters A–Z.
The optional min_length pads the result with leading zeros — handy for fixed-width fields like byte values or color codes:
The result is always text, not a number. To go the other way — reading a base-N string back into a decimal value — use DECIMAL.
Tip: BASE is the general-purpose converter. For the classic computing bases there are dedicated functions too: DEC2BIN, DEC2HEX, and DEC2OCT.
Try it: interactive demo
Pick a BASE example to see the formula and its result.
Practice workbook
Frequently asked questions
What range of bases does BASE support?
Does BASE return a number or text?
=BASE(255,16) returns the string "FF", which you can't do arithmetic on directly. Convert it back with DECIMAL if you need a numeric value.What does the min_length argument do?
=BASE(100,16,4) returns "0064" instead of "64". Results longer than min_length are left unchanged.How is BASE different from DEC2HEX?
DEC2HEX is limited to hexadecimal (and a smaller range, with two's-complement handling of negatives). Use BASE for general conversions.Master functions like this in one day
This page covers one function. Our Excel Formulas and Functions class covers the 30 that matter most — live, hands-on, taught by professionals in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.
See the Formulas & Functions Class