Skip to content
Google Sheets

BASE function in Google Sheets

Converts a number into a text representation in another base, for example, base 2 for binary. .

=BASE(value, base, [min_length])

BASE syntax and parameters

Three arguments, two required.

  • valuenumberRequired
  • basenumberRequired
  • min_lengthnumberOptional

BASE examples

Formulas you'll actually reuse.

  1. A number as an 8-bit binary string, zero-padded:

    =BASE(B2, 2, 8)

    Result"00101010"

  2. The same number in hexadecimal:

    =BASE(B2, 16)

    Result"2A"

BASE in Excel

Same name — your formula ports as-is.

Try BASE in the playground

Edit the example — nothing to install.

Preloaded with the BASE formula from Example 1 — change anything and watch it respond.

Loading the editor…

BASE errors

What they mean — and the fixes.

  • #NUM!

    The number is negative, or the radix is outside 2–36.