0xCONVERTER-HEX

Base 16 → base 8

Hex to Octal Converter

Convert hexadecimal to octal — and see why this is the one pair that has no tidy digit-for-digit shortcut.

Hexadecimal in

Octal

Decimal

Why this conversion is different

Hex to binary is a substitution. Binary to hex is a regrouping. Hex to octal is neither, and the reason is arithmetic: a hex digit is four bits, an octal digit is three, and four does not divide into three or the other way round. There is no fixed number of hex digits that maps onto a whole number of octal digits.

The shortcut that does exist

Both bases go through binary cleanly. Expand each hex digit to four bits, re-group the whole bit string into threes from the right, and read each group as an octal digit. Binary is the common ground.

How to convert hex to octal

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

Worked example

1A2B to octal

  expand   1    A    2    B
          0001 1010 0010 1011

  join     0001101000101011

  regroup from the right, in threes
          0  001  101  000  101  011
  pad     000  001  101  000  101  011

  read      0    1    5    0    5    3

  result → 15053   (leading zero dropped)

Digit reference

The mismatch is visible in the table: octal runs out of digits at 7 and needs two positions where hex still has one.

HexDecimalBinaryOctal
0000000
1100011
2200102
3300113
4401004
5501015
6601106
7701117
88100010
99100111
A10101012
B11101113
C12110014
D13110115
E14111016
F15111117

Where octal still turns up

Octal is much rarer than hex today, but it has not disappeared, and where it survives it is usually because three bits map onto something meaningful.

  • Unix file permissions. chmod 755 is three octal digits, one per permission group, each holding read, write and execute as three bits. This is the single most common octal encounter.
  • Older minicomputer architectures. Machines with 12, 18, 24 or 36-bit words divided evenly by three, so octal was the natural shorthand before the byte became universal.
  • Numeric literals. A leading zero means octal in C, which has caused a long history of bugs — 010 is eight, not ten. Modern languages prefer an explicit 0o prefix for exactly that reason.

Hex won because hardware settled on eight-bit bytes, and eight divides by four but not by three. That argument is set out in full in hex versus octal.

Landmark values

HexOctalDecimal
8108
F1715
102016
1F3731
4010064
7F177127
80200128
FF377255
100400256
FFFF17777765,535

FF becoming 377 is the clearest illustration of the mismatch: a value that fills two hex digits exactly needs three octal digits and still leaves the top one underused.

Frequently asked questions

How do I convert hex to octal?

Expand each hex digit to four bits, join them, then regroup the bit string into threes from the right and read each group as an octal digit.

Why is there no direct hex to octal shortcut?

A hex digit is four bits and an octal digit is three. Neither divides into the other, so the digits never line up. Binary is the common ground between them.

What is FF in octal?

377. Both represent 255 in decimal.

What is hex 10 in octal?

20. Both represent sixteen.

Where is octal still used?

Most commonly in Unix file permissions, where each of the three digits holds read, write and execute as three bits. It also appears in older architectures with word sizes divisible by three.

Does a leading zero mean octal?

In C and languages that copied it, yes, which is a well-known source of bugs. Modern languages prefer an explicit 0o prefix.