Octal (Base 8) to Hexadecimal (Base 16) Converter

Convert octal numbers to hexadecimal.

FF

377 (base 8) = FF (base 16)

Digits in base 8: 0 to 7. Digits in base 16: 0 to 9 and A to F.

How to convert Octal to Hexadecimal

Every positional number system works the same way: a digit is worth its own value times the base raised to the power of its position. In base 8 the place values, from the right, are 80 = 1, 81 = 8, 82 = 64 and so on.

Most pairs have no direct trick, so go through decimal, the base we all calculate in. First turn the base 8 number into decimal, then divide by 16 and read the remainders from the bottom up. Two short steps, and you can check the number in the middle.

Both 8 and 16 are powers of 2, so there is a faster way that skips decimal. Write each digit as 3 bits, then regroup the bits in groups of 4 from the right and replace each group with a base 16 digit.

The method

decimal value = each digit × its place value, all added upplace values in base 8: 1, 8, 64, 512, 4096, and so ondivide by 16, keep the remainder, repeat until the quotient is 0the answer is the remainders read from last to first1 base 8 digit = 3 bits1 base 16 digit = 4 bitsdigits in base 8: 0 to 7digits in base 16: 0 to 9 and A to F

Worked example 1: 55 from octal to hexadecimal

Step 1: base 8 to decimal55 (base 8) = 5 × 81 + 5 × 80= 40 + 5= 45Step 2: decimal to base 1645 ÷ 16 = 2 remainder 13 (D)2 ÷ 16 = 0 remainder 2Read the remainders from the bottom up: 2D55 (base 8) = 2D (base 16)

Letters stand for values from 10 up: A = 10, B = 11, C = 12 and so on. Remainders come out last digit first, which is why you read them from the bottom up. Digits that are 0 add nothing to the sum, so they are left out of the expansion.

Worked example 2: 377 from octal to hexadecimal

Step 1: base 8 to decimal377 (base 8) = 3 × 82 + 7 × 81 + 7 × 80= 192 + 56 + 7= 255Step 2: decimal to base 16255 ÷ 16 = 15 remainder 15 (F)15 ÷ 16 = 0 remainder 15 (F)Read the remainders from the bottom up: FF377 (base 8) = FF (base 16)

Worked example 3: 1750 from octal to hexadecimal

Step 1: base 8 to decimal1750 (base 8) = 1 × 83 + 7 × 82 + 5 × 81= 512 + 448 + 40= 1,000Step 2: decimal to base 161,000 ÷ 16 = 62 remainder 862 ÷ 16 = 3 remainder 14 (E)3 ÷ 16 = 0 remainder 3Read the remainders from the bottom up: 3E81750 (base 8) = 3E8 (base 16)

Worked example 4: 265 with the bit-group shortcut

265 (base 8)Write each digit as 3 bits: 2 = 010, 6 = 110, 5 = 101Join them and drop leading zeros: 10110101Split into groups of 4 from the right: 1011 0101Replace each group with its digit: 1011 = B, 0101 = 5265 (base 8) = B5 (base 16)

Both bases are powers of 2, so there is no need to go through decimal. Groups of 4 bits make one base 16 digit.

Need the other direction? Open the Hexadecimal to Octal converter.

Octal to Hexadecimal examples

The decimal number 255 is written 377 in octal and FF in hexadecimal.

Common Octal to Hexadecimal values
OctalHexadecimalDecimal
111
222
777
1088
12A10
17F15
201016
402032
1004064
14464100
377FF255
17503E81000

Where Octal to Hexadecimal comes up

Octal uses the digits 0 to 7, and each octal digit stands for exactly three bits. Unix file permissions such as chmod 755 are written in octal, and it also appears in older machine listings where word sizes divide by three.

Hexadecimal (base 16) uses 0 to 9 and A to F, and each hex digit stands for exactly four bits, so one byte is always two hex digits. You see it in web colours like #FF8800, memory addresses, MAC addresses, hash values and byte dumps.

Going to a larger base packs more value into each digit, so the result is shorter. The number 255 needs 3 digits in octal and 2 in hexadecimal.

Octal to Hexadecimal FAQ

How do I convert octal to hexadecimal?

Convert to decimal first by adding up each digit times its place value, then divide that decimal number by 16 repeatedly and read the remainders from last to first. Because both bases are powers of 2, you can also skip decimal and work with groups of bits.

Which digits does octal use?

Base 8 uses the digits 0 to 7. For example, 8 is not a valid digit in base 8.

Will the hexadecimal number be longer or shorter?

Shorter. Going to a larger base packs more value into each digit, so the result is shorter. Roughly 0.75 hexadecimal digits for every octal digit. The number 255 needs 3 digits in octal and 2 in hexadecimal.

Is there a shortcut for octal to hexadecimal?

Yes. Both 8 and 16 are powers of 2, so there is a faster way that skips decimal. Write each digit as 3 bits, then regroup the bits in groups of 4 from the right and replace each group with a base 16 digit.

Can I convert negative numbers or fractions?

The converter handles whole numbers, and a leading minus sign works for negatives. Fractions use a different method, where you repeatedly multiply the fractional part by the new base, and they are not supported here.