Guide
Octal to hexadecimal: three bits in, four bits out
Older documents, assembly listings and some Unix utilities give numbers in octal, whereas debuggers and modern specifications prefer hexadecimal. Moving a constant from one to the other is a common chore, and a pocket calculator will often handle it only through decimal. This page uses the direct route through the bits and prints it.
The two-step method
First write every octal digit as three bits, using 0 → 000 up to 7 → 111, and join the results. Second, cut the bit string into groups of four, beginning at the binary point and moving outward, and pad the outermost group with zeros. Convert each group to a hex digit from 0 to F. No decimal arithmetic appears anywhere, so the method is both fast and exact.
Why the first digit looks small
Because three does not divide four, the outermost hex group often has fewer real bits than the others. A nine-bit octal number, for example, always gives a first hex digit of 0 or 1. The padding zeros are only there to complete the group; they carry no value. If you see an unexpected 1 at the start, count the bits of the original, and it will usually explain itself.
Options
Hexadecimal output can be upper or lower case; the prefix switch adds 0x, and digit grouping splits long answers into blocks. The octal input may start with 0o, and spaces and underscores are ignored. If you give several numbers on separate lines, each is converted and the working describes the first. A digit 8 or 9 is flagged with its position, which is a common sign that a value was already decimal.
Edge cases
Zeros at the left of the result are removed. Octal fractions are supported: 0.4 is 100 in bits and, padded to 1000, becomes 0.8 in hex. Negative numbers retain the sign without conversion to a complement. Extremely long values work normally, since the page uses big integers; this matters for 64-bit constants written in octal in some legacy listings, which a 53-bit float would round.
A worked example
The Sample button loads 755, the permission mode for a typical executable. The digits expand to 111, 101 and 101, giving 111101101, nine bits. Regrouped from the right in fours it becomes 0001 1110 1101, which reads 1, E and D, so the hexadecimal result is 1ED. In decimal the value is 493. If you try 777, the bits are 111111111 and the hex is 1FF, which is 511, the largest value nine bits can hold.
Limits
The result is a number, not a mode. Hex is rarely used for permissions, so the hexadecimal form of 755 is mainly a way to check an exercise. The page cannot tell you whether a constant was meant to be a signed value, and it does not enforce a word size. If a document uses a prefix style the page does not know, remove it before pasting, because only 0o, spaces and underscores are stripped automatically.
Related tools
- Hex to Octal converts in the opposite direction with the same regrouping.
- Octal to Binary performs only the first step and prints the bits.
- Binary to Hex covers the second step on its own.
- Octal to Decimal gives the plain numeric value.
Checked against the current version of the Octal to Hex on .

