gettoolz.app

Hex to octal converter

Convert hex numbers to octal — through binary, 4 bits per hex digit regrouped by 3. Exact at any size, with a worked example and a table of common values. Free, and computed in your browser.

Part of developer tools.

Base

Binary

10101101

Octal

255

Decimal

173

Hexadecimal

AD

Hex to octal table

DecimalHexOctal
000
111
222
333
444
555
666
777
8810
9911
10A12
11B13
12C14
13D15
14E16
15F17
161020
10064144
1277F177
255FF377
256100400
10003E81750
10244002000
4096100010000
65535FFFF177777
4294967295FFFFFFFF37777777777
18446744073709551615FFFFFFFFFFFFFFFF1777777777777777777777

The last rows are the largest 32-bit and 64-bit unsigned values. The second is past the point where ordinary JavaScript numbers start rounding; the table and the converter above both compute with BigInt, so every digit is exact.

How to convert hex to octal

Hex and octal digits do not map onto each other: a hex digit holds 4 bits and an octal digit 3. The reliable route is through binary: expand each hex digit to 4 bits, regroup the bits by 3 from the right, and read each group as one octal digit. For AD: 1010 1101 → 010 101 101 → 255.

Hex and octal side by side

The largest 16-bit value is FFFF in hex and 177777 in octal: 4 digits against 6. Both bases are powers of two, but 4 bits against 3 only line up every 12 bits — 3 hex digits for 4 octal digits — which is why the conversion goes through binary. Octal survives mainly in Unix file permissions, where each digit is one read-write-execute triplet: 755 is rwx r-x r-x. In JavaScript and Python source, 173 is written 0xAD in hex and 0o255 in octal. Paste a prefixed number into the converter and it switches to the matching base; a number with no prefix is read in the selected base — hex on this page.

Other conversions

Going the other way? Octal to hex converter.

Or open the full number base converter and see a number in all four bases at once.