Octal to Hex Converter

Convert base-8 octal values to hexadecimal

Ad placeholder (leaderboard)

Converting octal to hexadecimal is less direct than octal to binary, because octal and hex group bits in different sizes. This converter bridges the two through binary and shows the intermediate bit string so the method is transparent.

How it works

Octal is base 8, which packs three bits per digit (8 is 2 cubed). Hexadecimal is base 16, which packs four bits per digit (16 is 2 to the fourth). Since 3 and 4 do not align cleanly, there is no one-to-one octal-to-hex digit mapping. The correct algorithm uses binary as a common ground:

1. Expand each octal digit to its 3-bit triplet.
2. Concatenate to form one binary string.
3. Left-pad the string so its length is a multiple of 4.
4. Split into 4-bit nibbles and map each to a hex digit.

The tool performs exactly these steps and displays the binary bridge so you can follow the regrouping.

Example

Convert octal 755. Expanding each digit gives 111, 101, 101, so the binary string is 111101101. Padding to a multiple of four (000111101101) and regrouping into nibbles yields 0001 1110 1101, which maps to 1, E, D — so the hex result is 0x1ED. As a check, octal 755 equals decimal 493, and 0x1ED is also 493.

Tips and notes

The intermediate bit string is the key to understanding why a naive digit swap does not work between octal and hex. Spaces, underscores and a leading 0o are accepted and ignored. All processing happens locally in your browser.

Ad placeholder (rectangle)