
Convert hexadecimal values to octal text in Excel. Useful when you need to move data from a base-16 format into a base-8 format.
HEX2OCT converts hexadecimal text into octal text. If a value starts in base 16 and needs to end up in base 8, this function does that translation for you.
That is not as common as decimal conversion, but it is still useful when you move data between systems that use different number formats. In those cases, HEX2OCT saves you from converting through intermediate steps by hand.
HEX2OCT is a format-translation function for cases where two technical systems use different compact bases. It is less about everyday spreadsheet arithmetic and more about moving a value into the representation another system or workflow expects, while keeping the meaning of the value unchanged.
Turns a base-16 value into base-8 text.
Returns a string made of digits 0 through 7.
=HEX2OCT(number, [places])
number is the hex value to convert. places is optional and pads positive results with leading zeros.
The result stays in text form because the goal here is format conversion, not arithmetic. Use places when the octal output should match a set width. If you leave it out, Excel returns the shortest positive octal result it can.
number must be a valid hexadecimal input. places is optional and mainly useful for fixed-width output. It affects positive results only. If the converted octal value is longer than the places value, Excel returns #NUM!.
HEX2OCT is the right choice when the destination format needs to stay in octal text:
| Function | What it does | Typical use | Result |
|---|---|---|---|
HEX2OCT |
Converts hex to octal | Move base-16 values into base-8 form | Octal text |
HEX2DEC |
Converts hex to decimal | Get a number for math | Number |
HEX2BIN |
Converts hex to binary | Inspect bits | Binary text |
OCT2HEX |
Converts octal to hex | Go in the opposite direction | Hex text |
The main use is direct translation between two technical number systems. If one system gives you hex and another expects octal, HEX2OCT helps you move between them without first converting the value manually.
The places argument can pad positive results with leading zeros. That matters when the output needs to match a fixed display width or a code format. If the converted result is longer than the places value, Excel returns #NUM!.
Signed negative values work differently. Excel ignores places for negative input and returns a full signed octal result, which is why HEX2OCT("FFFFFFFFFF") gives a 10-character octal string instead of a short one.
This is the direct hex-to-octal conversion pattern. Excel takes the compact hex value 3A and returns the octal equivalent 72. That is helpful when data has to move into a base-8 format without first being rewritten manually in decimal.
The example is useful because it shows a clean conversion between two non-decimal systems. Instead of doing extra steps through decimal by hand, the function moves straight from hex text to octal text.
=HEX2OCT("3A") // Returns "72"
Convert Hex "3A" to octal.
Padding matters when the output is expected to match a fixed-width octal code such as a permission-style value. Here, 1ED becomes 755, and the width keeps the result in the conventional form normally used for that kind of code.
This makes the example easier to relate to real use. Many learners recognize 755 as a permission code, so the formula helps explain where that octal-style result comes from.
=HEX2OCT("1ED", 3) // Returns "755"
Convert Hex "1ED" to a 3-digit padded octal (755).
This example shows the signed engineering-format behavior during conversion. The hex input represents -1, so HEX2OCT returns the full signed octal form 7777777777 rather than a short unsigned result.
That is important because the long output is not random. It is Excel's way of preserving the signed meaning of the input across the base conversion.
=HEX2OCT("FFFFFFFFFF") // Returns "7777777777"
Convert -1 (Hex FFFFFFFFFF) to 10-character octal.
The value FF becomes 0377, which is the same octal value but in a fixed-width form. That is useful when the worksheet needs column-aligned codes or outputs that must follow an exact field layout.
This example shows that places is about formatting the result for the destination system. The number stays the same, but the output is shaped to fit the required layout.
=HEX2OCT("FF", 4) // Returns "0377"
Convert Hex "FF" to a 4-digit octal offset.
HEX2OCT is a direct translation function for cases where a value starts in hexadecimal form but needs to end up as octal text. In this lesson, that meant moving between two compact technical numbering systems without having to convert manually through several intermediate steps.
The main takeaway is that the function changes the representation, not the underlying value. It returns text for compatibility and formatting purposes, and the optional places argument helps only when a positive result needs to fit a fixed-width octal layout.
Tell your friends about this post