DevSwitch.net
Back to Tools
#

Hexadecimal to Octal Converter

Convert hexadecimal numbers to octal format

Number Converters

Tip: Enter a hexadecimal number (0-9, A-F). The conversion happens in real-time.

Runs in your browser

Hex Octal

Octal base 8
-
Try

Convert hex to octal

Type a hex number and the octal result appears as you type. A 0x prefix and lowercase letters are accepted, results longer than four digits are also shown in groups of three, and the window bar shows the bit length.

Hex and octal don't line up digit for digit: a hex digit is four bits and an octal digit three. The easy route goes through binary, and that is what the step-by-step window shows for your number.

How to convert hexadecimal to octal by hand

Go through binary: hex digits to bits, then bits to octal digits. For 1F4:

  1. Write each hex digit as four bits

    1 is 0001, F is 1111 and 4 is 0100, so 1F4 becomes 0001 1111 0100.

  2. Regroup the bits in threes

    Drop the leading zeros and split 111110100 from the right into 111 110 100.

  3. Write each group as an octal digit

    111 is 7, 110 is 6 and 100 is 4, so 1F4 is 764 in octal.

To check it, 1F4 is 500 in decimal, and 7 × 64 + 6 × 8 + 4 = 500 as well.

Hex to octal table

HexOctal
7 7
8 10
F 17
10 20
1F 37
3F 77
40 100
7F 177
80 200
FF 377
1ED 755
1FF 777
FFF 7777
FFFF 177777

A run of F's becomes 7s in octal, with a leading 1 or 3 or none, depending on how the bits split into threes: FF is 377, FFF is 7777 and FFFF is 177777.

Starting from octal?

The octal to hex converter takes the same route through binary in the other direction.

For the decimal value, use the hex to decimal converter; the number system converter shows binary, decimal, hex and octal side by side.

Hex to octal questions

377. FF is 11111111 in binary, and split into 11 111 111 from the right that is 3, 7 and 7.

You can, but it takes long division. Through binary every step is a lookup: four bits per hex digit, three bits per octal digit.

755, the Unix permission rwxr-xr-x. Both are 493 in decimal.

No. You get the bare octal digits. Add 0o yourself if your code needs it.

No. The conversion runs in your browser.