BIN2DEC Function (LibreOffice Calc)
The BIN2DEC function converts a binary (base‑2) number into its decimal (base‑10) equivalent. Supports signed 10‑bit binary values using two’s complement.
Verification status: Consult the documentation, examples and any stated test scope below. How formula examples are checked
Availability and version history
- Introduced: Documented by LibreOffice 26.8.1.1; original introduction not established.
- Availability: Supported in LibreOffice 26.8.1.1, verified against its function registry. This identifies a supported release, not a final working version.
- Scope: Desktop Calc, using the English function name. Availability in other spreadsheet applications is separate.
- Checked: 2026-10-14 — function reference; versioned support. Documentation/source check; not a new native test. Existing example-specific test claims below retain their stated scope.
What the BIN2DEC Function Does
- Converts binary → decimal
- Accepts up to 10 bits
- Supports signed values using two’s complement
- Useful for bitwise workflows, encoding, and low‑level data processing
Syntax
BIN2DEC(binary_number)
Arguments
- binary_number:
A text string representing a binary number (e.g.,"1011").
Basic Examples
Convert simple binary to decimal
=BIN2DEC("1010")
→ 10
Convert using a cell reference
=BIN2DEC(A1)
Convert a signed 10‑bit binary number
=BIN2DEC("1111111111")
→ -1
Advanced Examples
Convert a binary value stored as text
=BIN2DEC(TEXT(A1; "0000000000"))
Convert a binary result from BIT* functions
=BIN2DEC(BASE(BITOR(A1; A2); 2; 10))
Convert a padded binary string
=BIN2DEC(RIGHT("0000000000" & A1; 10))
Convert a two’s‑complement negative number
=BIN2DEC("1111110110")
→ -10
Convert a binary string generated from DEC2BIN
=BIN2DEC(DEC2BIN(A1; 10))
Edge Cases and Behavior Details
BIN2DEC returns a numeric value
Accepts:
- Binary strings up to 10 bits
- Signed values using two’s complement
- Leading zeros
Behavior details
- Maximum unsigned input:
"1111111111" - Two’s complement range:
- Minimum: –512
- Maximum: +511
- Input must be text or a number containing only 0s and 1s
- Negative values require full 10‑bit representation
Invalid input → Err:502
BIN2DEC of an error → error propagates
Common Errors and Fixes
Err:502 — Invalid binary number
Cause:
- Contains characters other than 0 or 1
- More than 10 bits
- Empty string
Fix:
- Validate input
- Use TEXT or RIGHT to enforce 10‑bit width
Unexpected negative result
Cause:
- Input interpreted as two’s complement
Fix:
- Ensure correct bit width
- Use DEC2BIN for consistent formatting
Best Practices
- Always pad binary values to 10 bits for predictable signed behavior
- Use DEC2BIN for generating compatible binary strings
- Combine with BIT* functions for bitwise workflows
- Validate input to avoid Err:502
- Use BASE for arbitrary‑length binary conversions
Related Patterns and Alternatives
- Use DEC2BIN for decimal → binary
- Use BIN2OCT and BIN2HEX for other base conversions
- Use BASE for arbitrary‑length binary strings
- Use VALUE to sanitize imported text
By mastering BIN2DEC and its companion functions, you can build powerful binary‑processing and encoding workflows in LibreOffice Calc.
Reproducible example (tested in LibreOffice Calc)
This standalone example was calculated in LibreOffice Calc 25.2.3.2 and matched the expected value. It is a practical cross-check of one usage, not proof that every example elsewhere on this page is correct.
=BIN2DEC("1010")
Expected result: 10.
Convert the binary digits 1010 to decimal.
If the result differs, check the referenced cells, argument separators and number formatting. For more information, consult the LibreOffice Calc official help.