How to convert Octal to Hexadecimal
Octal and hexadecimal digits don't line up with each other (3 bits vs 4 bits), so the fastest route is through binary: expand each octal digit to bits, then regroup the bits in 4s from the right and read off the hexadecimal digits. No decimal arithmetic needed.
Worked example
Convert 725 (octal) to hexadecimal:
- Expand
725to binary:111010101 - Regroup the bits in 4s from the right:
0001 1101 0101 - Read off the digits:
1D5
So 725 in octal is 1D5 in hexadecimal.
Octal to Hexadecimal conversion table
| Octal | Hexadecimal |
|---|---|
| 0 | 0 |
| 1 | 1 |
| 2 | 2 |
| 3 | 3 |
| 4 | 4 |
| 5 | 5 |
| 6 | 6 |
| 7 | 7 |
| 10 | 8 |
| 11 | 9 |
| 12 | A |
| 13 | B |
| 14 | C |
| 15 | D |
| 16 | E |
| 17 | F |
Frequently asked questions
- Can this handle numbers larger than 64 bits?
- Yes. Conversion runs on arbitrary-precision integers, so numbers of any length convert exactly. Many online converters silently lose precision above 2⁵³ (about 16 decimal digits) — this one doesn't.
- How do I convert negative numbers?
- A leading minus sign works in every base. For the bit-pattern view programmers usually want, switch the mode to two's complement at 8, 16, 32, or 64 bits — then binary, octal, and hex show the bit pattern while decimal shows the signed value.
- Can I convert the other way, or to other bases?
- Use the Hexadecimal to Octal converter, or just change the From/To dropdowns above — every common base is shown at once anyway, and a Text mode converts ASCII to bytes and back.
Need arithmetic rather than conversion — adding hex numbers, shifting bits, masking? Use the programmer's calculator.