Excel functions / Math

HEX2DEC function

Turns a hexadecimal number into an ordinary one.

Syntax

=HEX2DEC(number)

Arguments

When to use it

HEX2DEC reads a hexadecimal number and gives it as an ordinary number. It takes apart colour codes and the codes that come out of systems and devices.

Examples

  1. FF as a number

    ABC
    1Hex
    2FF255

    In C2: =HEX2DEC(A2) → 255

    Try this example

  2. The green part of a colour code

    ABC
    1Colour
    2#0F7A49122

    In C2: =HEX2DEC(MID(A2, 4, 2)) → 122

    Try this example

Common mistakes

HEX2DEC in other languages

Excel shows function names in its own language. In these languages it also puts a semicolon between arguments where English has a comma.

Translate a whole formula

Try HEX2DEC in the playground

Related functions