How to Convert a Hex File to Binary
- 1). Understanding the relationship between hex and binary and the conversion of a hex file to binary is easy. Binary uses a base of two; decimal uses a base of ten; and hex uses a base of 16. The base determines how many digits are used in a particular numbering system. Binary uses only two digits: 0 and 1. The decimal system uses 10 digits: 0 through 9. The hex system uses 16 symbols: 0 through 9, plus A through F. Computers like to use base 2 because that means memory locations (and many other things) only need to be in two states: 0 and 1.
- 2). Know why it is easy to convert from hex to binary and why hex preserves the underlying structure of the binary patterns and you will understand why it is easy (and desirable) to convert back and forth from hex to binary. Converting between hex and decimal works well because the numbers 2 and 16 are related in a special way. When 2 is multiplied by itself four times it becomes equal to 16. This means that one symbol of hexadecimal represents the same amount of information as four digits of binary, and this is the key to converting hex to decimal: one hex digit always represents the same four binary digits. The Hex is more compact, easier to read and still has the binary pattern easily visible beneath the hex symbols.
- 3). Convert a hex file to a binary file one symbol at a time. Use the following transformations throughout the hex file to convert each hex symbol to four binary symbols. 0 becomes 0000,1 becomes 0001, 2 becomes 0010, 3 becomes 0011, 4 becomes 0100, 5 becomes 0101, 6 becomes 0110, 7 becomes 0111, 8 becomes 1000, 9 becomes 1001, A becomes 1010, B becomes 1011, C becomes 1100, D becomes 1101, E becomes 1110 and F becomes 1111. The binary file will have four times the number of symbols as the hex file, but will contain exactly the same information.
Source...