Take the binary number and divide it into groups of 4 bits starting from the right hand side , if no group of 4 exists fill out leading 0's, then convert each group of 4 to a hex number directly e.g.
11111102 -> hex direct
111 1110 add leading zero
0111 1110
111 -> 7H
1110 -> 1410 ->EH
11111102 -> 7EH
This is easily achieved in reverse by converting hex straight to binary i.e. divide the hex number into single hex digits from the right hand side and convert to binary each digit e.g.
7EH -> binary direct
7 -> 1112
E -> 1410 ->11102
7EH -> 11111102