# Convert from base 16 to base 2

Hex or hexadecimal is a counting system based on 16 characters. This counting system is particularly interesting, because in the commonly used decimal system, there are only 10 digits to represent the numbers. Because the hex system has 16 digits, the 6 extra digits (in addition to the 10 digits in the decimal system) are represented by the first 6 letters of the English alphabet. Therefore, the hex digits included 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 and A, B, C, D, E, F. This number system is most commonly used in math and information technology. In HTML programming, attributes color can be expressed as a 6-digit hexadecimal number: FFFFFF represent white, 000000 represent black, etc.

Binary uses two characters 0 and 1 to express a value.

Binary has been applied in ancient Egypt, China and India for a variety of purposes. In the modern world, binary has become the language of electronics and computer science. This is the most efficient system for detecting electrical signals: Off (0) and turn on (1). It is also the basis for binary code used to edit data on a computer. Even the digital text you are currently reading also includes binary numbers.

Reading a binary number is easier than you think. This is a counting system that uses a quantitative position, so each digit in a binary number is raised to a power of 2, starting from the rightmost position 2.0. In radix 2, each binary digit refers to 1 bit.

## How to read binary numbers

To convert binary to decimal, some basic knowledge of how to read binary numbers can help. As mentioned above, in binary counting using a quantitative position, each bit (binary digit) is a power of 2. This means that every binary number can be expressed as powers of 2, with the rightmost position being 20.

For example, binary numbers (1010)2 may also be written as follows:

(1 * 23) + (0 * 22) + (1 * 21) + (0 * 20)

### Example of converting base 16 to base 2

• (1E3)16 = (0001 1110 0011)2
• (0A2B)16 = (0000 1010 0010 1011)2
• (7E0C)16 = (0111 1110 0000 1100)2

0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
A 1010
B 1011
C 1100
D 1101
E 1110
F 1111

.