0xCONVERTER-HEX

Base 8 → base 16

Octal to Hex Converter

Convert octal to hexadecimal by regrouping three-bit digits into four-bit nibbles.

Octal in

Hex

Decimal

How to convert octal to hex

  1. Expand each octal digit into its three-bit pattern.
  2. Join the bits into one continuous string.
  3. Re-group into fours, counting from the right.
  4. Pad the leftmost group with zeros if it is short.
  5. Read each group of four as a hex digit from 0 to F.

Octal digits and their bits

OctalBinaryDecimal
00000
10011
20102
30113
41004
51015
61106
71117

Eight digits, three bits each. Compare that with hex, which needs sixteen digits and four bits, and the reason the two never line up becomes obvious.

Worked example

15053 to hex

  expand   1   5   0   5   3
          001 101 000 101 011

  join     001101000101011

  regroup from the right, in fours
          001 1010 0010 1011
  pad    0001 1010 0010 1011

  read      1    A    2    B

  result → 1A2B

A worked permissions example

Unix permission modes are the most common octal values people need to translate, and they show why octal is the better notation for that particular job.

chmod 755

  7 = 111  owner:  read, write, execute
  5 = 101  group:  read,        execute
  5 = 101  others: read,        execute

  as bits   111 101 101
  as hex    0001 1110 1101  → 1ED

755 is instantly readable as three permission triples. 1ED is the same number and tells you nothing at a glance. Where the underlying structure is three bits wide, octal is genuinely the right choice — which is why it survives there and almost nowhere else.

Landmark values

OctalHexDecimalNote
777Largest single octal digit
1088Octal rolls over three positions early
17F15Largest single hex digit
1004064Octal's third position
377FF255One full byte
400100256One byte overflowed
7771FF511Three octal digits full
177777FFFF65,535A full 16-bit word

Reading octal safely

Two habits prevent most octal mistakes. First, check the prefix: a leading zero means octal in C and its descendants, so 0755 and 755 can be different numbers depending on the language. Second, remember that octal has no digits 8 or 9 — if you see one, the value is not octal, and the converter above will tell you so rather than guess.

Frequently asked questions

How do I convert octal to hex?

Expand each octal digit to three bits, join them, then regroup the bit string into fours from the right and read each group as a hex digit.

What is octal 777 in hex?

1FF. Both represent 511 in decimal.

What is chmod 755 in hex?

1ED. But hex is the wrong notation for permissions, because the underlying fields are three bits wide and octal shows them directly.

Why does octal have no 8 or 9?

Base 8 uses only the digits 0 through 7. A value of eight rolls over to 10 in octal, the same way ten rolls over to 10 in decimal.

Does a leading zero matter?

In C-family languages a leading zero marks an octal literal, so 010 is eight rather than ten. This converter treats your input as octal regardless.

Can I convert octal directly to hex without binary?

Only by going through the value itself. There is no digit-level mapping, because three bits and four bits do not divide into each other.