BASE

    Math & Trig

    Converts a number into a text representation with the given radix (base), optionally padded with leading zeros to a minimum length.

    Translations
    EnglishBASE
    FrenchBASE
    SpanishBASE
    GermanBASIS
    ItalianBASE
    PortugueseBASE
    DutchBASIS
    PolishPODSTAWA
    RussianОСНОВАНИЕ
    TurkishTABAN
    CzechZÁKLAD
    HungarianALAP
    SwedishBAS
    DanishBASIS
    FinnishPERUS
    Syntax
    BASE(number, radix, [min_length])

    Arguments

    • numberThe non-negative integer to convert (0 to 2^53 − 1).
    • radixThe base radix to convert to (2 to 36).
    • min_lengthOptional. Minimum length of the resulting string (0 to 255), padded with leading zeros.(optional)
    Examples
    =BASE(15,2)
    1111

    15 in binary

    =BASE(255,16)
    FF

    255 in hexadecimal

    =BASE(7,2,8)
    00000111

    Binary padded to 8 chars

    Tips & Best Practices
    • Available since Excel 2013
    • Returns #NUM! if number, radix or min_length is out of range
    • Use DECIMAL() to convert back from a base-N string to a number
    Common Mistakes
    • Forgetting that BASE's output is text, not a number, so leading zeros (from min_length) are preserved and the result can't be used directly in arithmetic without conversion
    • Passing a radix outside the valid 2-36 range, which returns a #NUM! error since BASE only supports number systems representable with digits 0-9 and letters A-Z
    • Confusing BASE with DECIMAL - BASE converts a decimal number into another base as text, while DECIMAL does the reverse, converting base-N text back into a decimal number
    Related Functions
    DECIMALPerforms the reverse operation - converts a base-N text string back into a decimal number, undoing what BASE produces.
    DEC2BINConverts specifically to binary with its own set of limitations, a more specialized alternative to BASE's general-purpose any-radix conversion.
    DEC2HEXConverts specifically to hexadecimal, another specialized alternative to BASE for a single fixed target radix.
    Frequently Asked Questions

    Why does BASE return a #NUM! error?

    The radix is likely outside the valid range of 2 to 36, or the number or min_length arguments are out of their allowed bounds - double-check each argument against BASE's limits.

    Can I use BASE's output in a calculation?

    Not directly - BASE returns text, not a number, particularly important when min_length adds leading zeros that would otherwise be dropped in a numeric context.

    How do I convert a number back from a different base to decimal?

    Use DECIMAL(text, radix), the inverse function - it takes text in a given base and returns the equivalent decimal number.

    Need to translate a formula using BASE?

    Use our translator to convert your complete formula