Engineering

DEC2BIN Function in Excel

Converts a decimal number to binary.

Syntax

  • =DEC2BIN(number, [places])

Arguments

  • number (required): Decimal number (-512 to 511)
  • places (optional): Number of characters to use

Examples

  • =DEC2BIN(9, 4) - Decimal to binary - Result: 1001

DEC2BIN in technical sheets

  • Document units in adjacent cells — many engineering functions require exact unit strings.
  • Use [CONVERT](/functions/convert/) for unit changes before specialized formulas.
  • Validate inputs with [ISNUMBER](/functions/isnumber/) and range checks.

Common errors

  • #NUM! if out of range

Use cases

  • Number conversion
  • Binary representation
  • Programming

Frequently asked questions

  • What is DEC2BIN used for? DEC2BIN converts decimal numbers to binary (base 2). =DEC2BIN(10) returns '1010'. Useful for programming, understanding computer data representation, and working with binary protocols or flags.
  • Why is DEC2BIN limited to -512 to 511? DEC2BIN uses 10-bit two's complement representation. Positive max: 2^9-1=511, negative min: -2^9=-512. For larger numbers, use a custom formula or convert via hexadecimal: =DEC2HEX then HEX2BIN for each digit.
  • How do I pad binary output with leading zeros? Use the places parameter: =DEC2BIN(5, 8) returns '00000101' (8 digits). This ensures consistent width for comparing or concatenating binary values. Without places, leading zeros are omitted.

Editorial review

  • Reviewed by Excel.Directory Editorial Team. Updated May 2026.