FormulaCraft

BASE

BASE converts a non-negative decimal integer into a text representation in any radix between 2 and 36. For example, BASE(255,16) returns "FF" (hexadecimal) and BASE(10,2) returns "1010" (binary). An optional min_length argument pads the result with leading zeros.

Excel
=BASE(A2,16)
Google Sheets
=BASE(A2,16)

Verified example

Computed by a real spreadsheet engine on the sample data below.

DecimalHex
255
16
0
128

=BASE(A2,16)FF

Try it with your data

Edit the grid or formula, then run it through a real spreadsheet engine — no signup.

Sample data — click any cell to edit

Runs server-side · free · no signup

How it works

  1. 1A2 is the non-negative decimal integer to convert (e.g. 255).
  2. 216 is the target base (radix); valid values are 2 through 36.
  3. 3BASE(255,16) returns the text string "FF"; BASE(10,2) returns "1010".

Need a version for your data?

Try: “Convert decimal color codes to hexadecimal

Related

Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.

Last reviewed: