How the conversion works
Like hex-to-octal, this conversion uses binary as an intermediate step. First expand each octal digit into three binary bits, then regroup the full binary string into sets of four bits (nibbles) and translate each group to a hex digit.
For example, octal 37 becomes binary 011 111, which regroups as 0001 1111 (after left-padding), giving hex 1F.