Contact

BIN2HEX Function in ONLYOFFICE Spreadsheet Editor: Syntax, Examples and Troubleshooting

Engineering Beginner ONLYOFFICE Spreadsheet Editor

ONLYOFFICE BIN2HEX function guide: exact official formula syntax, argument defaults, practical binary to hexadecimal examples, width handling, error conditions, edition cautions and sources.

Verification status: Official documentation referenced; example outcomes independently reasoned or arithmetically checked where stated. Not executed in ONLYOFFICE Spreadsheet Editor. How formula examples are checked

Quick answer

Convert a binary (base-2) numeral into hexadecimal (base-16) digits. Four binary bits correspond to one hexadecimal digit. The documented formula is =BIN2HEX(number, [places]). For example, =BIN2HEX("00101101") has the independently calculated expected result 2D, while =BIN2HEX("00101101",4) has the expected result 002D. See the official BIN2HEX reference, checked 2026-10-13 (UTC).

Evidence boundary: Every displayed output is an independent mathematical expectation unless labelled as a vendor-documented error rule. Native ONLYOFFICE Docs web or Desktop execution, localized parsing and historical-edition regression tests were not performed. Hexadecimal expectations use uppercase letters; native letter casing and cell formatting are not asserted.

What BIN2HEX does—and when to use it

Convert a binary (base-2) numeral into hexadecimal (base-16) digits. Four binary bits correspond to one hexadecimal digit. This changes how an integer is represented; it does not rescale a measurement. As an example, decimal 45 can be written as binary 101101, octal 55, or hexadecimal 2D. Preserving fixed-width identifiers requires the optional places argument and careful cell formatting. The ONLYOFFICE function catalogue lists BIN2HEX in Engineering functions.

Use BIN2HEX when inspecting machine-generated flags, converting educational number-system examples, normalizing old identifiers, or preparing a fixed-width code for human inspection. It is not documented as a general parser for signed binary protocols, fractional numbers, textual prefixes like 0x, or arbitrary-length cryptographic bit fields. Those behaviors are not established by the linked function description.

Exact vendor syntax, arguments, types and defaults

=BIN2HEX(number, [places])
Position Argument Required? Official meaning Documented default / limitation
1 number Yes The binary (base 2) numeral, supplied directly or by cell reference. The official help article requires a recognized base-2 numeral of 10 characters or fewer. Its full signed/large-number behavior is not specified.
2 places No Desired count of digits in the hexadecimal (base 16) result. If omitted, the function uses the minimum number of digits. If specified, it must be positive and large enough for the result, or the article documents #NUM!.

Square brackets mark an optional parameter and are not entered literally. In the English-language reference, the first argument is always number; the optional second is places. Use parentheses and an initial = in a real spreadsheet formula. The official Insert functions guide illustrates comma-separated arguments; note that Advanced Settings offers formula-language and regional controls. Do not assume that a formula copied unchanged between localized editors always parses the same way.

Text input matters. Enter a base representation such as 00000101 as Text in cell B, or quote it as "00000101" inside a formula. Ordinary numeric auto-formatting can remove leading zeros before conversion. For a hexadecimal input containing A–F, quote the literal or store it in a text cell rather than treating it as a decimal numeric token. Upper/lowercase, leading/trailing spaces, signed inputs, noninteger places, and imported-type coercion should be confirmed in the target ONLYOFFICE edition; the checked reference is not an exhaustive behavior matrix.

Reproducible worksheet: 16 inputs and both output widths

  1. Open a blank ONLYOFFICE spreadsheet. Put Use case in A1, Source binary (base 2) in B1, Places in C1, Minimum output in D1, and Padded output in E1. Use these columns on an otherwise empty worksheet.
  2. Format B2:B17 as Text before entering the source strings. Copy each source value from the table into B2:B17, preserving any leading zeros. Enter 4 into every C2:C17 cell. Do not type the backticks displayed in the article.
  3. In D2 enter =BIN2HEX(B2); in E2 enter =BIN2HEX(B2,C2). Copy or fill both formulas through row 17. The source B and width C references will follow each row.
  4. Compare the two result columns against the independently calculated expectations. Preserve the source values and record any differences with the Desktop/web edition, installed version, formula language, and region. The article does not imply these results were personally observed in ONLYOFFICE.
  5. If a value contains leading zeroes, inspect the formula bar and the cell type. If the minimum-width column lacks zeros but the padded column has them, that is the intended mathematical width distinction, not proof that a given editor preserves them as text.
Row Source B (Text) Places C D: expected minimum E: expected padded
2 0 4 0 0000
3 1 4 1 0001
4 10 4 2 0002
5 11 4 3 0003
6 101 4 5 0005
7 1000 4 8 0008
8 1010 4 A 000A
9 1111 4 F 000F
10 10000 4 10 0010
11 101010 4 2A 002A
12 1100100 4 64 0064
13 11111111 4 FF 00FF
14 00101101 4 2D 002D
15 01010101 4 55 0055
16 00000101 4 5 0005
17 10011001 4 99 0099

Independent check: Convert each B value from base 2 to an exact integer and then render it in base 16. D is the minimal-width representation. E is that representation left-padded with zeroes to width 4. This is arithmetic verification, not a native spreadsheet test.

Copy-and-paste formula examples

The following literals do not require setting up the input table. Keep quotes around the input numeral so that intended leading zeros and hexadecimal letters are represented as text.

Formula Independent expected output Decimal value for checking
=BIN2HEX("1010") A 10
=BIN2HEX("1010",4) 000A 10
=BIN2HEX("11111111") FF 255
=BIN2HEX("11111111",4) 00FF 255
=BIN2HEX("00101101") 2D 45
=BIN2HEX("01010101",4) 0055 85
=BIN2HEX("0",4) 0000 0
=BIN2HEX("00000101",4) 0005 5

The leading-zero strings are digit sequences, not decimal fractions. Changing places adds output zeros on the left, without changing the numeric value represented. For important reports, inspect the actual stored cell value, not only the displayed number format.

Advanced and practical applications

Decode a sensor bit field

00101101 contains the set bit weights 32, 8, 4 and 1: decimal 45, hexadecimal 2D. =BIN2HEX("00101101") has the independent expected result 2D; =BIN2HEX("00101101",4) is 002D. Keep the padded text if a four-character code is required.

Translate an eight-bit byte

A full byte 11110000 groups as 1111 0000, so it is F0 in hexadecimal. =BIN2HEX("11110000",4) is expected to yield 00F0. The padding is display width, not a change in numeric value.

Round-trip with the inverse

=HEX2BIN(BIN2HEX("01010101"),8) is mathematically expected to give 01010101: binary 85 → hex 55 → padded eight-bit binary. Nested execution, casing and text formatting still need an ONLYOFFICE runtime check.

Cross-check through decimal

=DEC2HEX(BIN2DEC("00101101"),4) also has the independent expected value 002D. BIN2DEC and DEC2HEX are independently documented functions, but this composition has not been executed in ONLYOFFICE.

Errors, limits and troubleshooting

The official BIN2HEX article explicitly documents #NUM! if the numeral is not recognized in its stated base, if it has more than 10 characters, if the converted output needs more digits than places, or if places is less than or equal to 0. These are documentation claims, not a report of observed screen output. The following cases illustrate each published rule:

Formula to check Vendor-documented expected error class Why
=BIN2HEX("102") #NUM! according to the official documented rule; not natively observed Invalid source-base input: contains digit 2, which is not part of base 2.
=BIN2HEX("00000000000") #NUM! according to the official documented rule; not natively observed 11-character source numeral; the official page limits number to at most 10 characters.
=BIN2HEX("11111111",1) #NUM! according to the official documented rule; not natively observed The requested width is shorter than the independently determined converted numeral.
=BIN2HEX("1",0) #NUM! according to the official documented rule; not natively observed The official page says places less than or equal to zero returns #NUM!.
=BIN2HEX("1",-1) #NUM! according to the official documented rule; not natively observed A negative places value is also less than or equal to zero.

Important distinction: A mathematical conversion tool can evaluate arbitrarily long positive integers, but the ONLYOFFICE reference states a 10-character input limit. Do not claim that an arbitrarily long integer, a 10-digit negative representation or a large signed value is supported merely because Python or another spreadsheet program calculates it.

Troubleshooting sequence

  1. Confirm the input base: Binary (base 2) only uses digits 0 and 1. Check whether the cell holds the exact string, especially after CSV import. Remove prefixes and separators unless validated against a native build.
  2. Inspect the input length: more than ten characters is an official #NUM! condition. The page does not resolve sign-bit behavior for every value within ten characters; use positive examples with clear bit length for initial troubleshooting.
  3. Check output width: omit places to get the minimum-width representation. With places, use a positive width that fits all converted digits; shorter requests are documented to produce #NUM!.
  4. Verify entry language and punctuation: use the named function found in the editor’s Formula tab. English documentation uses commas; Advanced Settings lists a configurable formula language and regional settings. If the editor rejects a formula, check its active settings instead of blindly changing functions.
  5. Check text versus number types: protect significant leading zeros in the source. Check the actual result as a character sequence if your data exchange depends on fixed length. Do not treat a formatted-looking identifier as a numeric quantity.
  6. Isolate one cell: try =BIN2HEX("00101101") and compare with its independent expectation 2D before nesting formulas. Save the workbook version, software build and locale when reporting a difference.

Boundaries that still require native validation

The English vendor article does not establish a complete table of allowed signed ranges, ten-character negative/two’s-complement interpretations, maximum practical places width, fractional-width coercion, hexadecimal letter case, whitespace handling, or specific spreadsheet error labels beyond its stated #NUM! cases. Large values can exceed the binary result length of a positive ten-bit number even when the input is within ten characters. Check those cases in the target edition before relying on them.

Version, edition and compatibility notes

The current unversioned ONLYOFFICE Docs Insert Functions catalogue lists BIN2HEX. The Docs changelog and Desktop Editors changelog are separate histories, so the existence of the help article does not establish that this function behaves identically in all web and desktop editions. The visible Docs changelog lists 10.0.0 (October 10, 2026) and the Desktop changelog lists 9.4.0 (May 19, 2026); these are product release dates, not function-introduction dates. The first supported release for BIN2HEX was not established during this review.

The documented English syntax uses comma argument separators. ONLYOFFICE Advanced Settings describes both Formula Language and Region; interface translations and regional numeric display may differ from these sample expressions. Formula interoperability with Excel, LibreOffice, Google Sheets, historical releases or third-party converters is not inferred from ONLYOFFICE documentation. Use an actual test sheet in each target product before promising equal behavior, particularly for negative codes, fixed width or unusual invalid inputs.

Frequently asked questions

Why did the leading zeros disappear? With places omitted, ONLYOFFICE’s official syntax description says the result uses the minimum required digits. Use a fitting positive places value to request a fixed width and keep the source identifier in a text-formatted cell.

Does BIN2HEX work for negative inputs? This review does not establish the interpretation of ten-character sign-bit or signed encodings in each edition. The official article documents input recognition and length but does not provide a complete negative-value behavior matrix. Native testing is required before asserting a particular output.

Can I use a 12-character code? The vendor specifically documents a #NUM! condition for more than ten characters. Use a different verified conversion method for longer codes and document its separate limitations; do not bypass the limit by assuming all base-conversion functions share the same range.

How can I tell whether a conversion is right? Check the base-2 positional weights to derive the exact decimal value, then divide that integer by base 16 to reconstruct the output digits. Use the independent expected table above as a control, and confirm results in your specific editor build before deployment.

Claim-level sources, date and editorial verification

Claim Vendor source Checked
Function purpose, exact number, [places] syntax, optional default Official BIN2HEX help 2026-10-13 UTC
Input-recognition, ten-character limit, too-small/invalid places, #NUM! rule Official BIN2HEX help 2026-10-13 UTC
Engineering category and instructions for entering function formulas Spreadsheet Editor Insert Functions 2026-10-13 UTC
Formula language and region settings Advanced Settings 2026-10-13 UTC
Web/Docs release chronology not first support date Docs changelog 2026-10-13 UTC
Desktop release chronology not first support date Desktop changelog 2026-10-13 UTC

Verification limitations: Exact integer arithmetic verifies the positive examples. Error descriptions follow the vendor documentation; runtime errors, localized input and cross-edition compatibility have not been natively tested.