Loading...
Loading...
Enter octal values and get hex equivalents instantly. The tool converts through binary internally - you just see the final result.
Octal value (digits 0-7)
Hexadecimal (base-16)
Octal (base-8) and hexadecimal (base-16) do not share a convenient bit-grouping relationship with each other the way each shares with binary. Hex groups bits in fours; octal groups bits in threes. Because 3 and 4 have no common factor (other than 1), you cannot translate directly between them by simply regrouping digits the way you can between binary and either base.
The cleanest conversion path goes through binary. First, expand each octal digit to its 3-bit binary equivalent. Then regroup the resulting bits into groups of 4 from the right, padding the leftmost group if needed. Finally, replace each 4-bit group with its hex digit. The tool does all three steps automatically.
For example, octal 377 expands to binary 011 111 111. Regrouped into nibbles: 0011 1111 1111. Those nibbles are 3, F, F, giving hexadecimal 3FF. You can verify: 3FF in hex equals 1023 in decimal, and octal 377 also equals (3 x 64) + (7 x 8) + (7 x 1) = 192 + 56 + 7 = 255... that's 0xFF, not 3FF. Let the tool handle the arithmetic to avoid errors like that.
C language source code uses a leading zero to mark octal integer literals. A call like open("file", O_RDWR, 0644) passes the permission mask as the octal literal 0644. If you are porting this code to a language or tool that expects hex, you need to convert 644 octal to its hex equivalent (1A4 hex).
Legacy configuration files and some scripting environments express values in octal. If a modern API, web tool, or database column expects hex, you cannot copy the octal value directly. Paste it here to get the hex form.
Hardware documentation sometimes mixes both notations, with hex for addresses and octal for some field values inherited from older toolchains. This converter bridges the two without requiring mental calculation.
In C and C++, any integer literal starting with a zero (other than 0 itself, or the 0x hex prefix) is treated as octal. This means 010 is decimal 8, not decimal ten. Passing these values to APIs that print in hex - such as printf with %x - shows the hex equivalent.
If you see a constant like 0755 in C source code and need to express it as a hex value for documentation, a test assertion, or cross-language use, paste 755 here to get the corresponding hex string.
What is octal 755 in hex?
Octal 755 equals decimal 493. Decimal 493 divided by 16 gives 30 remainder 13 (D), then 30 divided by 16 gives 1 remainder 14 (E), then 1 divided by 16 gives 0 remainder 1. Reading bottom to top: 1ED. So octal 755 = hex 1ED.
Does the tool handle leading-zero octal literals from C code?
Yes. The leading zero prefix is stripped before conversion. You can paste 0755 directly from C source and the converter treats it as the octal number 755.
Is the hex output uppercase or lowercase?
Uppercase by default. Both 0x1ED and 0x1ed represent the same value; the tool uses uppercase for consistency with most debugger and documentation conventions.