BASE

Formulas / BASE
Convert numbers to other bases.
=BASE(number,radix,[min_length])
  • Number - the number to convert
  • Radix - the base radix to convert the number to
  • Min_length - [OPTIONAL] specifies how long the output string should be at a minimum

Examples

  • =BASE(13,2)

    The BASE function can be used to convert numbers to text in a base from 2 to 36. For example, the formula converts the number 13 to text in base 2, which returns “1101”.

  • =BASE(13,10)

    The BASE function can also be used to convert numbers from base 10 (decimal) to other bases. For example, the formula converts the number 13 to text in base 10, which returns “13”.

  • =BASE(13,16)The BASE function can also be used to convert numbers to hexadecimal. For example, the formula > converts the number 13 to text in base 16 (hexadecimal), which returns “D”.

  • =BASE(3,2,4)

    The BASE function can also be used to convert numbers to text with a specific width. For example, the formula converts the number 3 to text in base 2 with a width of 4, which returns “0011”.

  • =BASE(10,16,4)

    The BASE function can also be used to convert numbers from a base 10 to a base with a specific width. For example, the formula converts the number 10 to text in base 16 with a width of 4, which returns “000A”.

Summary

The BASE function is used to convert a number into its text representation using a radix or base, ranging from 2 to 36.

  • The BASE function takes three arguments: number, radix, and length. Radix must be an integer from 2 to 36 and specifies the base of a number. BASE pads the result with zeros to achieve the length specified in the min_length argument.
  • The BASE function returns the converted number as text.
  • BASE throws a #NUM! error if given a negative number. BASE ignores decimals.


Frequently Asked Questions

What is the BASE function?
The BASE function is a mathematical function that converts a number into a different base. The BASE function returns a text representation of the converted number.
What argument specifies the base?
The radix argument specifies the base.
What argument specifies the minimum length of the returned string?
The min_length argument specifies the minimum length of the returned string.
What errors can the BASE function throw?
  • #NUM! error if the arguments are not in the correct minimum or maximum range
  • #VALUE! error if the number entered is not a number
Does the BASE function pad the result with leading zeros?
Yes, if the min_length is specified, BASE pads the result with leading zeros.

Make Better Decisions
With Data

Analyze data, automate reports and create live dashboards
for all your business applications, without code. Get unlimited access free for 14 days.