DEC2BIN Function in Excel: Decimal to Binary

⏱ 1 min readUpdated 28 September 2026

EngineeringLevel: IntermediateAvailable in: Excel 2007+

In this article
  1. Syntax
  2. Examples
  3. Example 1
  4. Common errors and fixes
  5. Related functions

DEC2BIN converts a number to binary text. Good for teaching, flags and subnet masks, but it only handles −512 to 511.

Syntax

=DEC2BIN(number, [places])
Argument What it means
places Pad with leading zeros.

Examples

Example 1

=DEC2BIN(13, 8)

Returns 00001101.

Common errors and fixes

You see Why, and the fix
#NUM! Number outside −512…511. Use BASE(n, 2) for bigger values.

BIN2DEC · DEC2HEX · BASE

📚 Part of the free Excel course: Beginner → Expert · Try it in the Formula Lab or ask the AI Helper.

✨ Ask AI about this article

Stuck on a step? Ask a question and the AI answers using this article.

Free · AI can be wrong