Binary to Hex Converter
To use binary to hex converter, type a binary value e.g. "11101000" and click on the Convert button and you will get the hexadecimal value of "E8" on the right side. The binary to hexadecimal conversion is explained in detail below and hexadecimal values are based on radix "16" while binary values are based on radix "2".
Binary to Hex Conversion:
- Binary Numeral System
- Hexadecimal Numeral System
- How to Convert Binary to Hex
- How to Convert Binary Fraction to Hex
- Binary to Hex Examples
- FAQs (Binary to Hex Conversion)
- Binary to Hex Table
Binary Numeral System
The binary number system represents numbers using only two digits: 0 and 1, and it operates on a base, or radix, of 2. Binary values are expressed as powers of 2, such as 20, 21, 22, and so on. Each single binary digit is known as a bit, and a group of 8 bits together makes up a byte. For fractional values digits are represented with the negative powers e.g. 2-1, 2-2 ..
Example:
Binary value (10110.011)2 can be written as powers to the base 2:
Digit | Position | Power of 2 | Value |
---|---|---|---|
1 | 24 (Sixteens place) | 24 = 16 | 1 × 16 = 16 |
0 | 23 (Eights place) | 23 = 8 | 0 × 8 = 0 |
1 | 22 (Fours place) | 22 = 4 | 1 × 4 = 4 |
1 | 21 (Twos place) | 21 = 2 | 1 × 2 = 2 |
0 | 20 (Ones place) | 20 = 1 | 0 × 1 = 0 |
0 | 2-1 (Halves place) | 2-1 = 0.5 | 0 × 0.5 = 0 |
1 | 2-2 (Quarters place) | 2-2 = 0.25 | 1 × 0.25 = 0.25 |
1 | 2-3 (Eighths place) | 2-3 = 0.125 | 1 × 0.125 = 0.125 |
(10110.011)2 = (1 × 24) + (0 × 23) + (1 × 22) + (1 × 21) + (0 × 20) + (0 × 2-1) + (1 × 2-2) + (1 × 2-2) = (16 + 4 + 2 + 0.25 + 0.125) = (22.375)10 (Decimal)
Hexadecimal Numeral System (Hex Numbers)
Hexadecimal numbers, commonly referred to as hex numbers, are part of the base-16 numeral system, which uses 16 unique symbols to represent values. These symbols include the decimal digits 0 through 9 and the letters A to F, where A, B, C, D, E, and F represent the decimal values 10 through 15, respectively.
The hexadecimal system is widely used in computer science, digital electronics, programming, and other scientific applications because it provides a more compact and readable way to represent large binary numbers. In hex numbers, each digit represents a power of 16:
The rightmost digit is multiplied by 160.
The next digit to the left is multiplied by 161.
The following digit is multiplied by 162, and so on.
For fractional hexadecimal numbers, the values after the hexadecimal point are calculated using negative powers of 16. The first digit after the point represents 16-1, the second represents 16-2, and so forth.
Example:
Hex value "7BD4A" can be written as,
Digit | Position | Power of 16 | Value |
---|---|---|---|
7 | 164 (65536's place) | 164 = 65536 | 7 × 65536 = 458752 |
B (11) | 163 (4096's place) | 163 = 4096 | 11 × 4096 = 45056 |
D (13) | 162 (256's place) | 162 = 256 | 13 × 256 = 3328 |
4 | 161 (16's place) | 161 = 16 | 4 × 16 = 64 |
A (10) | 160 (1's place) | 160 = 1 | 10 × 1 = 10 |
Decimal Result: 458752 + 45056 + 3328 + 64 + 10 = 507210
(7BD4A)16 = (507210)10
How to Convert Binary to Hex
Four binary bits or digits constitute one hexadecimal digit or number e.g. "0000" in binary equals 0 in hex, "0001" in binary equals 1 in hex, "0111" in binary equals 7 in hex and "1110" in binary equals "E" in hex. All the binary number digits or bits positions represent the powers to the base 2.
Step-1: Represent the binary numbers in nibbles (four-bits) and identify the bits position as powers to the base 2.
Step-2: Multiply the position values with the bits values, add the results and convert the final decimal value to hex.
Step-3: Combine the final results of each nibble to represent the final hex value.
How to Convert Binary Fraction to Hex
The fractional binary value can be converted to hex using the following step:
Step-1: Take only the fractional part after the binary point (1011.1101) e.g. 1101 is the fractional part.
Step-2: Groups bits into a set of 4. If the last group has less than 4 bits, add trailing zeros to complete it.
Step-3: Convert each 4-bit group to its hex equivalent and combine them to get the fractional hex value.
Binary to Hex Examples
Example 1: Convert (10001010)2 to hex value.
Nibble-1 | Nibble-2 | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
23 | 22 | 21 | 20 | 23 | 22 | 21 | 20 | ||||||
Position: | 8 | 4 | 2 | 1 | 8 | 4 | 2 | 1 | |||||
Bits: | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 0 |
Results: | = | (8×1) + (4×0) + (2×0) + (1×0) | = | (8×1) + (4×0) + (2×1) + (1×0) | |||||||||
= | 8 + 0 + 0 + 0 | = | 8 + 0 + 2 + 0 | ||||||||||
= | (8)10 | = | (10)10 | ||||||||||
= | (8)16 | = | (A)16 |
Example 2: Convert (1101101)2 to hex value.
Nibble-1 | Nibble-2 | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
23 | 22 | 21 | 20 | 23 | 22 | 21 | 20 | ||||||
Position: | 8 | 4 | 2 | 1 | 8 | 4 | 2 | 1 | |||||
Bits: | 0 | 1 | 1 | 0 | 1 | 1 | 0 | 1 |
Results: | = | (8×0) + (4×1) + (2×1) + (1×0) | = | (8×1) + (4×1) + (2×0) + (1×1) | |||||||||
= | 0 + 4 + 2 + 0 | = | 8 + 4 + 0 + 1 | ||||||||||
= | (6)10 | = | (13)10 | ||||||||||
= | (8)16 | = | (D)16 |
Example 3: Convert (11011)2 to hex value.
Nibble-1 | Nibble-2 | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
23 | 22 | 21 | 20 | 23 | 22 | 21 | 20 | ||||||
Position: | 8 | 4 | 2 | 1 | 8 | 4 | 2 | 1 | |||||
Bits: | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 1 |
Results: | = | (8×0) + (4×0) + (2×0) + (1×1) | = | (8×1) + (4×0) + (2×1) + (1×1) | |||||||||
= | 0 + 0 + 0 + 1 | = | 8 + 0 + 2 + 1 | ||||||||||
= | (1)10 | = | (11)10 | ||||||||||
= | (1)16 | = | (B)16 |
Example 4: Convert (100111.101)2 to Hex value.
Nibble-1 | Nibble-2 | Nibble-3 | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
23 | 22 | 21 | 20 | 23 | 22 | 21 | 20 | 23 | 22 | 21 | 20 | ||||||||||
Position: | 8 | 4 | 2 | 1 | 8 | 4 | 2 | 1 | 8 | 4 | 2 | 1 | |||||||||
Bits: | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 1. | 1 | 0 | 1 | 0 |
Results: | = | (8×0)+(4×0)+(2×1)+(1×0) | = | (8×0)+(4×1)+(2×1)+(1×1) | = | (8×1)+(4×0)+(2×1)+(1×0) | |||||||||||
= | 0 + 0 + 2 + 0 | = | 0 + 4 + 2 + 1 | = | 8 + 0 + 2 + 0 | ||||||||||||
= | (2)10 | = | (7)10. | = | (10)10 | ||||||||||||
= | (2)16 | = | (7)16. | = | (A)16 |
Frequently Ask Questions: Binary to Hex Conversion
Q1: Convert 8-bit signed binary number 11110110 (2's complement) to hexadecimal?
Group the number into 4 bits: (1111 0110)2 = (F6)16
Beware of the decimal value here, since MSB = 1 so it is a negative number, Take 2's complement:
Invert bits: 00001001
Add 1: 00001001 + 1 = 00001010, so the value is -10 (decimal)
Q2: How to convert the values 1011.1011 to hex?
Since (1011)2 = (11)10 = (B)16, Therefore:
(1011.1011)2 = (B.B)16
Q3: What are the maximum 4-bit, 8-bit, 12-bit and 16-bit hexadecimal values?
Max value = 16N - 1 or 24b - 1, as each hex digit N = 4 × b.
For 4 bits or 1 hex digit, Maximal value = (15)10 = (F)16
For 8 bits or 2 hex digits, Maximal value = (255)10 = (FF)16
For 12 bits or 3 hex digits, Maximal value = (4095)10 = (FFF)16
For 16 bits or 4 hex digits, Maximal value = (65535)10 = (FFFF)16
Q4: What is the maximum hex value of unsigned 32-bit binary number?
(11111111111111111111111111111111)2 = (FFFFFFFF)16
Decimal = 168 - 1 = 4294967295, Here 8 hex digits are used = 32 bits
Q5: The 8-bit binary number 10101101 is shifted left by 2 bits. Convert the resulting binary number to hexadecimal?
(10101101)2 is shifted left by 2 bits. Resulting binary number is (10110100)2 (Discard the two overflow bits on the left side in 8-bit arithmetic).
Group bits into 4-bit groups (nibbles): (1011 0100)2 = (B4)16 in hex.
Q6: Perform a bitwise AND of 11011011 and 10110110. Represent the result in hexadecimal.
11011011 AND 10110110 = (10010010)2 = (92)16 in hex.
Binary to Hexadecimal Table
Binary | Hexadecimal |
---|---|
00000001 | 1 |
00000010 | 2 |
00000011 | 3 |
00000100 | 4 |
00000101 | 5 |
00000110 | 6 |
00000111 | 7 |
00001000 | 8 |
00001001 | 9 |
00001010 | A |
00001011 | B |
00001100 | C |
00001101 | D |
00001110 | E |
00001111 | F |
00010000 | 10 |
00010001 | 11 |
00010010 | 12 |
00010011 | 13 |
00010100 | 14 |
00010101 | 15 |
00010110 | 16 |
00010111 | 17 |
00011000 | 18 |
00011001 | 19 |
00011010 | 1A |
00011011 | 1B |
00011100 | 1C |
00011101 | 1D |
00011110 | 1E |
00011111 | 1F |
00100000 | 20 |
00100001 | 21 |
00100010 | 22 |
00100011 | 23 |
00100100 | 24 |
00100101 | 25 |
00100110 | 26 |
00100111 | 27 |
00101000 | 28 |
00101001 | 29 |
00101010 | 2A |
00101011 | 2B |
00101100 | 2C |
00101101 | 2D |
00101110 | 2E |
00101111 | 2F |
00110000 | 30 |
00110001 | 31 |
00110010 | 32 |
00110011 | 33 |
00110100 | 34 |
00110101 | 35 |
00110110 | 36 |
00110111 | 37 |
00111000 | 38 |
00111001 | 39 |
00111010 | 3A |
00111011 | 3B |
00111100 | 3C |
00111101 | 3D |
00111110 | 3E |
00111111 | 3F |
01000000 | 40 |
Binary | Hexadecimal |
---|---|
01000001 | 41 |
01000010 | 42 |
01000011 | 43 |
01000100 | 44 |
01000101 | 45 |
01000110 | 46 |
01000111 | 47 |
01001000 | 48 |
01001001 | 49 |
01001010 | 4A |
01001011 | 4B |
01001100 | 4C |
01001101 | 4D |
01001110 | 4E |
01001111 | 4F |
01010000 | 50 |
01010001 | 51 |
01010010 | 52 |
01010011 | 53 |
01010100 | 54 |
01010101 | 55 |
01010110 | 56 |
01010111 | 57 |
01011000 | 58 |
01011001 | 59 |
01011010 | 5A |
01011011 | 5B |
01011100 | 5C |
01011101 | 5D |
01011110 | 5E |
01011111 | 5F |
01100000 | 60 |
01100001 | 61 |
01100010 | 62 |
01100011 | 63 |
01100100 | 64 |
01100101 | 65 |
01100110 | 66 |
01100111 | 67 |
01101000 | 68 |
01101001 | 69 |
01101010 | 6A |
01101011 | 6B |
01101100 | 6C |
01101101 | 6D |
01101110 | 6E |
01101111 | 6F |
01110000 | 70 |
01110001 | 71 |
01110010 | 72 |
01110011 | 73 |
01110100 | 74 |
01110101 | 75 |
01110110 | 76 |
01110111 | 77 |
01111000 | 78 |
01111001 | 79 |
01111010 | 7A |
01111011 | 7B |
01111100 | 7C |
01111101 | 7D |
01111110 | 7E |
01111111 | 7F |
10000000 | 80 |
Binary | Hexadecimal |
---|---|
10000001 | 81 |
10000010 | 82 |
10000011 | 83 |
10000100 | 84 |
10000101 | 85 |
10000110 | 86 |
10000111 | 87 |
10001000 | 88 |
10001001 | 89 |
10001010 | 8A |
10001011 | 8B |
10001100 | 8C |
10001101 | 8D |
10001110 | 8E |
10001111 | 8F |
10010000 | 90 |
10010001 | 91 |
10010010 | 92 |
10010011 | 93 |
10010100 | 94 |
10010101 | 95 |
10010110 | 96 |
10010111 | 97 |
10011000 | 98 |
10011001 | 99 |
10011010 | 9A |
10011011 | 9B |
10011100 | 9C |
10011101 | 9D |
10011110 | 9E |
10011111 | 9F |
10100000 | A0 |
10100001 | A1 |
10100010 | A2 |
10100011 | A3 |
10100100 | A4 |
10100101 | A5 |
10100110 | A6 |
10100111 | A7 |
10101000 | A8 |
10101001 | A9 |
10101010 | AA |
10101011 | AB |
10101100 | AC |
10101101 | AD |
10101110 | AE |
10101111 | AF |
10110000 | B0 |
10110001 | B1 |
10110010 | B2 |
10110011 | B3 |
10110100 | B4 |
10110101 | B5 |
10110110 | B6 |
10110111 | B7 |
10111000 | B8 |
10111001 | B9 |
10111010 | BA |
10111011 | BB |
10111100 | BC |
10111101 | BD |
10111110 | BE |
10111111 | BF |
11000000 | C0 |
Binary | Hexadecimal |
---|---|
11000001 | C1 |
11000010 | C2 |
11000011 | C3 |
11000100 | C4 |
11000101 | C5 |
11000110 | C6 |
11000111 | C7 |
11001000 | C8 |
11001001 | C9 |
11001010 | CA |
11001011 | CB |
11001100 | CC |
11001101 | CD |
11001110 | CE |
11001111 | CF |
11010000 | D0 |
11010001 | D1 |
11010010 | D2 |
11010011 | D3 |
11010100 | D4 |
11010101 | D5 |
11010110 | D6 |
11010111 | D7 |
11011000 | D8 |
11011001 | D9 |
11011010 | DA |
11011011 | DB |
11011100 | DC |
11011101 | DD |
11011110 | DE |
11011111 | DF |
11100000 | E0 |
11100001 | E1 |
11100010 | E2 |
11100011 | E3 |
11100100 | E4 |
11100101 | E5 |
11100110 | E6 |
11100111 | E7 |
11101000 | E8 |
11101001 | E9 |
11101010 | EA |
11101011 | EB |
11101100 | EC |
11101101 | ED |
11101110 | EE |
11101111 | EF |
11110000 | F0 |
11110001 | F1 |
11110010 | F2 |
11110011 | F3 |
11110100 | F4 |
11110101 | F5 |
11110110 | F6 |
11110111 | F7 |
11111000 | F8 |
11111001 | F9 |
11111010 | FA |
11111011 | FB |
11111100 | FC |
11111101 | FD |
11111110 | FE |
11111111 | FF |
Related Conversions
Please find the related numeric conversions.