HEX2OCT Function (Calligra Sheets)
Convert hexadecimal text to octal in Calligra, using letter-case-insensitive digits, minimum output width and reproducible conversion checks.
Verification status: Selected formulas were executed through the Calligra Sheets 25.04.2 calculation engine library. Version 26.08.2 was source-checked only. How formula examples are checked
Quick answer: =HEX2OCT("FF";4) gives 0377 in the tested Calligra calculation engine. The result is text, including any leading zeroes.
Availability and version history
- Introduced: First release not established; the name is present in Calligra 2.4.0 source.
- Supported in: Calligra Sheets 26.08.2, with no retirement established.
- Scope: Desktop Sheets with the Engineering module. Examples use English semicolon-separated formulas.
- Checked: October 14, 2026. Formulas were executed through the official 25.04.2 engine library and checked against source and independent mathematics. This is not GUI-cell or workbook-import evidence; 26.08.2 was source-checked, not executed.
What HEX2OCT returns
HEX2OCT interprets hexadecimal digits and returns the corresponding base-8 text. For example, hexadecimal FF is decimal 255, which is octal 377 because 3×64+7×8+7=255. The input and output strings use different place weights. Function help.
Syntax and arguments
=HEX2OCT(hexadecimal[;places])
Hexadecimal is required and places is an optional minimum octal output length. The wrapper accepts digits 0–9 and letters A–F in either case. A sign, surrounding spaces or the 0x prefix is not part of this function’s accepted digit-only input, even though DECIMAL or HEX2DEC may accept some of those forms. Brackets mark an optional argument and are not entered in a formula. Registration and implementation, with versioned help.
Reproducible engine examples
Backticks preserve literal leading zeroes in text results. Numeric decoder results do not preserve an input field’s padding.
| Formula | Engine result |
|---|---|
=HEX2OCT("0") |
0 |
=HEX2OCT("A") |
12 |
=HEX2OCT("f") |
17 |
=HEX2OCT("10") |
20 |
=HEX2OCT("FF";4) |
0377 |
=HEX2OCT("1CD";4) |
0715 |
=HEX2OCT("200") |
1000 |
=HEX2OCT("FF";2) |
377 |
Practical worksheet
Put the text FF in A2 and 4 in B2. =HEX2OCT(A2;B2) produces 0377. Places counts octal output digits. The leading zero is part of the returned string, so retain text storage if the value is exported to an identifier field.
Advanced interpretation and checks
The recorded check =OCT2HEX(HEX2OCT("01CD");4) returns 01CD. Hexadecimal 1CD and octal 715 both represent decimal 461. The inner conversion has no knowledge that the input had a leading zero; the final width of four restores that presentation deliberately.
A field-capacity check is separate from minimum padding. HEX2OCT("FF";2) returns 377, because three octal digits are necessary. Do not cut off a significant digit to make the output fit a two-character destination. Instead validate the destination’s maximum value before exporting.
Input boundaries and cautions
The engine returned #VALUE! for G, a negative sign, surrounding whitespace and 0xFF. Lowercase f was accepted and converted to 17. A negative width left the natural output, while a fractional width was converted to an integer. These cases describe this strict wrapper, not every hexadecimal parser in the application.
| Formula | Engine result |
|---|---|
=HEX2OCT("G") |
#VALUE! |
=HEX2OCT("-1") |
#VALUE! |
=HEX2OCT(" FF ") |
#VALUE! |
=HEX2OCT("0xFF") |
#VALUE! |
=HEX2OCT("F";-1) |
17 |
=HEX2OCT("A";3.9) |
012 |
Numeric range and data handling
The shared encoder narrows the decoded value to a C++ int before formatting. These small exact examples do not establish conversion of arbitrarily long identifiers. Keep original strings and validate both the intended value and destination field capacity. The Engineering module and conversion helper are byte-identical in the inspected 25.04.2 and 26.08.2 sources.