The Excel OCT2HEX function converts a octal (base-8) number to hexadecimal (base-16) — a staple for digital electronics, low-level programming, and bit manipulation.
Syntax
| Argument | Description | |
|---|---|---|
number | Required | The octal number to convert, as text or a value. |
places | Optional | Pad the result to this many characters with leading zeros (useful for fixed-width output). |
How to use it
OCT2HEX converts a octal (base-8) value to hexadecimal (base-16). The result is returned as text, so pad it with the optional places argument for fixed-width displays.
Round-trip tip: every conversion has an inverse — pair this with the reverse function to validate. All base functions cap inputs at 10 characters (signed), so very large numbers need a different approach.
Try it: interactive demo
Type a octal value and watch it convert to hexadecimal.
Practice workbook
Frequently asked questions
Why is the OCT2HEX result text, not a number?
What is the places argument for?
Why do I get #NUM!?
How do negative numbers work?
Master functions like this in one day
This page covers one function. Our Excel Formulas and Functions class covers the 30 that matter most — live, hands-on, taught by professionals in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.
See the Formulas & Functions Class