Syntax
| Parameter | Description |
|---|---|
| number | Parameter of the DEC2BIN function. |
| [places] | (Optional.) Parameter of the DEC2BIN function. |
Examples
Basic conversion
=DEC2BIN(10)
With leading zeros
=DEC2BIN(10, 8)
Negative number (two's complement)
=DEC2BIN(-1)
Common Errors
The number is outside the valid range (-512 to 511), or the places argument is too small to hold the result.
The argument is non-numeric, or places is negative or non-integer.
Tips
DEC2BIN returns a text string, not a number. '1010' is text representing binary, not the decimal one thousand and ten.
DEC2BIN handles 10-bit signed integers. For larger numbers, you'll need a custom conversion formula or VBA.
Use the places argument (=DEC2BIN(n, 8)) to always show 8-digit binary, which is standard for byte-level work.
Try DEC2BIN in Viztab
Import your data and use DEC2BIN with 370+ other formulas. No signup required.
Open Viztab