Excel functions / Math

DEC2BIN function

Writes a whole number in binary.

Syntax

=DEC2BIN(number, [places])

Arguments

When to use it

DEC2BIN writes a whole number in binary (base 2), as text of 0s and 1s. A second argument pads it to a number of digits.

Examples

  1. Ten in binary

    ABC
    1Number
    2101010

    In C2: =DEC2BIN(A2) → 1010

    Try this example

  2. Padded to eight digits

    ABC
    1Number
    21000001010

    In C2: =DEC2BIN(A2, 8) → 00001010

    Try this example

Common mistakes

DEC2BIN 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 DEC2BIN in the playground

Related functions