How can I use the BASE function in Google Sheets to convert numbers from one base to another?

How can I use the BASE function in Google Sheets to convert numbers from one base to another?

The BASE function in Google Sheets is a mathematical tool that allows users to easily convert numbers from one base to another. This function takes two arguments: the number to be converted and the base to which it will be converted. By specifying the desired base, the function will automatically convert the given number to the corresponding base and return the result. This function is especially useful for working with different number systems, such as binary, hexadecimal, or octal, and can save time and effort in manual conversions. By utilizing the BASE function, users can quickly and accurately convert numbers between different bases in their Google Sheets documents.

BASE function

The BASE function converts a decimal number into a text representation in another base. For example, base 2 for binary.

Parts of a BASE function

BASE(value, base, [min_length])

PartDescriptionNotes
valueThe number to convert into base.
  • The value should be an integer greater than or equal to zero.
baseThe base (or radix) to convert the value number into.
  • The base should be an integer from 2 to 36.
min_length(Optional) The minimum length of the text returned.
  • If the minimum length value is greater than the number of significant digits in the result, the result is left-padded with zeroes until the total number of digits reaches significant_digits.

Sample formulas

BASE(255, 16)

BASE(A2, 2)

BASE(4095, 16, 6)

Notes

  • Non-integer numeric argument values are truncated to an integer.
  • Make sure that any calculations using the result of the BASE function take into account that it may be in a non-decimal base. Results are silently converted by Google Sheets. For example, if cell A2 contains 1111 (the binary equivalent of the decimal value 31), and B2 contains a formula such as “=A2+9,” the result will be 11120, which is incorrect in binary calculation.

Examples

This example converts the decimal number 255 to base 16 (hexadecimal):

 AB
1FormulaResult
2=BASE(255, 16)FF

 

This example converts the number in cell A2 (decimal value 21) to the base given in cell B2 (binary):

 ABCD
1NumberBaseFormulaResult
2212=BASE(A2, B2)10101

 

This example converts the decimal number 4095 to base 16 (hexadecimal) with a minimum length of 6 characters:

 AB
1FormulaResult
2=BASE(4095, 16, 6)000FFF

Related functions

  • DECIMAL: The DECIMAL function converts the text representation of a number in another base, to base 10 (decimal).
  • BIN2DEC:  The BIN2DEC function converts a signed binary number to decimal format.
  • BIN2HEX: The BIN2HEX function converts a signed binary number to signed hexadecimal format.
  • BIN2OCT: The BIN2OCT function converts a signed binary number to signed octal format.
  • OCT2BIN: The OCT2BIN function converts a signed octal number to signed binary format.
  • OCT2DEC: The OCT2DEC function converts a signed octal number to decimal format.
  • OCT2HEX: The OCT2HEX function converts a signed octal number to signed hexadecimal format.
  • DEC2BIN: The DEC2BIN function converts a decimal number to signed binary format.
  • DEC2OCT: The DEC2OCT function converts a decimal number to signed octal format.
  • DEC2HEX: The DEC2HEX function converts a decimal number to signed hexadecimal format.
  • HEX2BIN: The HEX2BIN function converts a signed hexadecimal number to signed binary format.
  • HEX2DEC: The HEX2DEC function converts a signed hexadecimal number to decimal format.
  • HEX2OCT: The HEX2OCT function converts a signed hexadecimal number to signed octal format.

Cite this article

stats writer (2024). How can I use the BASE function in Google Sheets to convert numbers from one base to another?. PSYCHOLOGICAL SCALES. Retrieved from https://scales.arabpsychology.com/stats/how-can-i-use-the-base-function-in-google-sheets-to-convert-numbers-from-one-base-to-another/

stats writer. "How can I use the BASE function in Google Sheets to convert numbers from one base to another?." PSYCHOLOGICAL SCALES, 30 Jun. 2024, https://scales.arabpsychology.com/stats/how-can-i-use-the-base-function-in-google-sheets-to-convert-numbers-from-one-base-to-another/.

stats writer. "How can I use the BASE function in Google Sheets to convert numbers from one base to another?." PSYCHOLOGICAL SCALES, 2024. https://scales.arabpsychology.com/stats/how-can-i-use-the-base-function-in-google-sheets-to-convert-numbers-from-one-base-to-another/.

stats writer (2024) 'How can I use the BASE function in Google Sheets to convert numbers from one base to another?', PSYCHOLOGICAL SCALES. Available at: https://scales.arabpsychology.com/stats/how-can-i-use-the-base-function-in-google-sheets-to-convert-numbers-from-one-base-to-another/.

[1] stats writer, "How can I use the BASE function in Google Sheets to convert numbers from one base to another?," PSYCHOLOGICAL SCALES, vol. X, no. Y, ص Z-Z, June, 2024.

stats writer. How can I use the BASE function in Google Sheets to convert numbers from one base to another?. PSYCHOLOGICAL SCALES. 2024;vol(issue):pages.

Download Post (.PDF)
PDF
Scroll to Top