previous | start | next

Converting between binary and hex

It is easy to convert between binary and hex (this is because 16 is a power of 2).

To convert from binary to hex just partition the binary into groups of 4 bits. Then convert each 4 bit pattern to the corresponding hex "digit".

To convert the other way from hex to binary is even easier. Just expand each hex "digit" into its 4 bit equivalent binary value.



    binary:  00101101
            

             0010 1101
                2    D

    hex:     2D


previous | start | next