Contact

DECIMAL in Google Sheets: Decode Base-Specific Text into Numeric Values

Math Intermediate Google Sheets

Read binary and octal strings with Sheets DECIMAL, preserve source width and verify conversions through positional arithmetic.

Verification status: See the evidence and test scope described in this guide. How formula examples are checked

Quick answer: DECIMAL converts a base-specific representation into a base-ten numeric value. =DECIMAL("11010",2) has the expected result 26. It is a radix-conversion function, not a decimal-place rounding function.

Availability and version history

  • Introduced: first launch date or introduction version not established by the official history reviewed.
  • Availability: documented in the rolling Google Sheets service; this guide uses ordinary cells in the web editor, without a claim about identical mobile authoring workflows.
  • Checked: October 14, 2026 against the official DECIMAL reference. Examples were independently calculated; no native Sheets execution was performed.

Syntax and the checked domain

=DECIMAL(value, base)

Both arguments are required. Google describes value as an unsigned string and base as an integer from 2 through 36. It limits the source string to 255 characters, excludes scientific notation and describes positive-integer output. Official DECIMAL reference

The notes use imprecise wording about numeric characters despite the wider base range. This tutorial’s primary examples therefore use positive, digit-only representations in bases 2, 8 and 10. It does not claim a tested alphabetic-digit, signed-input, zero, large-number or error-code matrix.

Example 1: compare binary and octal representations

=DECIMAL("11010",2)
=DECIMAL("32",8)
=DECIMAL("26",10)

Expected numeric result for each: 26. The input strings differ because each base uses different place values.

For 11010 in base 2, the nonzero places contribute 16, 8 and 2. For 32 in base 8, the value is 3×8+2. The decimal representation 26 is 2×10+6.

Quoting digit-only literals keeps the intended source representation explicit. When using cells, preserve them as text before import rather than relying on how a numeric value happens to display.

Example 2: leading zeros are representation, not quantity

=DECIMAL("00011010",2)

Expected result: 26. The three extra leading zeros do not add any value. If the eight-character width matters to an external code format, keep the source string in a separate column.

=LEN("00011010") is 8. That source width cannot be reconstructed from numeric 26 alone, because many padded strings represent the same quantity. Conversion is intentionally discarding that presentation detail.

Prepare an auditable conversion table

Enter the following data in A1:B5, using Plain text formatting for A2:A5:

A: Representation B: Base
1011 2
11100 2
17 8
42 8

In C2 enter =DECIMAL(A2,B2) and fill down. Expected C2:C5: 11, 28, 15, 34. A total with =SUM(C2:C5) is 88.

Keep both representation and base with the converted result. Changing the base without changing the characters changes the interpreted quantity, even if the formula remains syntactically valid.

Advanced example: compare numeric distances between codes

For binary strings 001100 in E2 and 010001 in E3:

=DECIMAL(E3,2)-DECIMAL(E2,2)

Expected result: 5, because the values are 17 and 12. This gives distance in numeric values. It does not measure how many character positions differ, count issued codes or prove that all intermediate codes exist.

For an independent check, binary 010001 contains 16+1, while 001100 contains 8+4. Their difference is 17−12 = 5.

Advanced example: sort representations by their actual value

Put octal text 7, 10, 21, 3 in G2:G5 and =DECIMAL(G2,8) in H2 filled down. Expected helper values: 7, 8, 17, 3.

Use =SORT(G2:H5,2,TRUE) in J2, leaving J2:K5 clear. Expected rows are 3 | 3, 7 | 7, 10 | 8, 21 | 17. The first column preserves the octal representation; the second holds the numeric sorting key. SORT returns those four rows without adding a heading.

Sorting digit strings alphabetically is a different operation. Always move complete records together so a representation does not become detached from its base or numeric value.

Input validation and precision

A binary string containing digit 2 is outside the stated base’s digit set. A source written in scientific notation is excluded by Google’s documented rule. The checked page does not name every error code for these cases, so inspect the actual error rather than importing another program’s classification.

A 255-character string allowance is not a promise of 255-digit arithmetic precision. Keep large identifiers as text when exact digit preservation matters and test the target application’s numeric limits separately. Once an import has rounded a long numeric source, DECIMAL cannot recover the discarded information.

Use small exact controls before extending the formula to real data, and preserve raw input alongside any error-handled display. A review flag can improve readability, but replacing every invalid conversion with zero would conceal the distinction between an input problem and a measured value.

Verification: Expected results use fictional data and independent calculations rather than native Google Sheets observations. See the editorial testing standards.