Summary

The Excel HEX2OCT function converts a hexadecimal number to its octal equivalent.

Purpose
Converts a hexadecimal number to octal
Return value
Octal number
Syntax
=HEX2OCT(number, [places])
  • number - The hexadecimal number you want to convert to octal.
  • places - [optional] Pads the resulting binary number with zeros up to the specified number of digits. If omitted returns the least number of characters required to represent the number.

Using the HEX2OCT function

  • Excel only converts to octal numbers of 10-digits or less, restricting the range of valid input to [0, 7777777777] (octal).
  • The input number must be less than or equal to ten alpha-numeric characters, otherwise the function returns the #NUM! error value.

Negative Numbers

Excel interprets both octal and hexadecimal numbers using two's complement notation. Two's complement notation is a convention that computers use to represent negative numbers in binary.

Example of two's complement for HEX2OCT function

Support Exceljet

Many websites (including Exceljet) have lost over half their traffic in the past year because of the crushing impact of AI on web searches. Exceljet is still at it, publishing free content each week. If you find Exceljet helpful, you can support the site and go ad-free with the Exceljet Lifetime Pass. One payment, no subscription, and ads are gone forever. Plus, you get our Excel Shortcuts video course as a thank you.

Get the Lifetime Pass

Dave Bruns Profile Picture

AuthorMicrosoft Most Valuable Professional Award

Dave Bruns

Hi - I'm Dave Bruns, and I run Exceljet with my wife, Lisa. Our goal is to help you work faster in Excel. We create short videos, and clear examples of formulas, functions, pivot tables, conditional formatting, and charts.