How binary-to-hex conversion works
Because 16 is a power of 2, each hexadecimal digit maps to exactly four binary digits (a nibble). Group the binary number into sets of four from the right, pad with leading zeros if needed, and translate each group to its hex digit.
For example, binary 11011110 splits into 1101 and 1110, which map to D and E, giving hex DE.