To convert binary to hex, group the bits into sets of 4 (starting from the right), then replace each group with its hex digit.
Example: Convert to hex. Group: 1101 0110. The group 1101 is D (13 in decimal). The group 0110 is 6. Result: D6. Reverse works too: D6 in hex becomes 11010110 in binary.
If the leftmost group has fewer than 4 bits, pad with zeros. For , pad to get 0101 0110, which is 56 in hex. This conversion is so fast that many programmers think in hex when debugging low-level code.