The Hex Calculator is used to perform addition, subtraction, multiplication and division on two hexadecimal numbers.
Hexadecimal number system (Hex) is just like decimal and binary number system. Where in decimal system the base is 10 and in binary system the base is 2, the base in hexadecimal system is 16. In Hex, we use digits 0-9 and alphabets A to F. The decimal numbers 0-9 are same in Hex system but for decimal numbers 10-15, we have A-F in Hex. For decimal numbers 16-25, we resume our counting of Hex from 10. Since we mostly use decimal numbers, it is easier to understand Hex in terms of decimal numbers. The following table shows how each number in decimal has an equivalent number in Hex.
Dec | Hex |
---|---|
0 | 0 |
1 | 1 |
2 | 2 |
3 | 3 |
4 | 4 |
5 | 5 |
6 | 6 |
7 | 7 |
8 | 8 |
9 | 9 |
10 | a |
11 | b |
12 | c |
13 | d |
14 | e |
15 | f |
Dec | Hex |
---|---|
16 | 10 |
17 | 11 |
18 | 12 |
19 | 13 |
20 | 14 |
21 | 15 |
22 | 16 |
23 | 17 |
24 | 18 |
25 | 19 |
26 | 1a |
27 | 1b |
28 | 1c |
29 | 1d |
30 | 1e |
31 | 1f |
Dec | Hex |
---|---|
32 | 20 |
33 | 21 |
34 | 22 |
35 | 23 |
36 | 24 |
37 | 25 |
38 | 26 |
39 | 27 |
40 | 28 |
41 | 29 |
42 | 2a |
43 | 2b |
43 | 2c |
44 | 2d |
45 | 2e |
46 | 2f |
There’s no way we can remember this table or draw it every time we are using Hex system, but we can easily convert from decimal system to Hex and vice versa. If you know how to convert from binary to decimal or from decimal to binary, Hex conversion will be very easy for you because it is similar to binary conversion.
Lets’ start by converting a Hex number (4FD in this case) to a decimal number. For this, we will use place values. Starting from the right hand side, D is the lowest number and 4 is the highest number. So, we will multiply the lowest number with the lowest power of 16. The lowest power of 16 is 0. Then multiply the next number (F in this case) with the next highest power of 16 (which is 1). Lastly, multiply the highest number (4 in this case) with the highest power of 16 (which is 2 here). Then add all the products to find the decimal equivalent of 4FD. It comes out to be 1277. We Also have age calculator, which you should check out to know your exact age.
4FD = (4 x 162) + (F x 161) + (D x160)
= (4 x 256) + (15 x 16) + (13 x 1)
= 1024 + 240 + 13
= 1277
Let’s convert the decimal number 1277 back to Hex. We will also know for sure if our conversion is correct because we know that it should be 4FD. We will use synthetic division for conversion from decimal to Hex. This means that we will continuously divide the number by 16 unless our number becomes less than 16. This process is a little complicated so we will divide it into steps.
Once, we are clear on conversions, we will move towards arithmetic operations on Hex numbers. Addition of Hex numbers is quite similar to how we do it in case of decimal numbers.
1 | 1 | ||
4 | 2 | A | |
+ | 8 | D | B |
D | 0 | 5 |
0 | 16 | 16 | |
D | 4 | A | |
- | 8 | C | B |
4 | 7 | F |
Multiplication in Hex is same as multiplication in decimal.
1 | 8 | 0 | ||
2 | 9 | 0 | ||
2 | D | |||
x | A | C | ||
0 | 2 | 1 | C | |
+ | 1 | C | 2 | 0 |
1 | E | 3 | C |
Long division in Hex is same as long division in decimal except that subtraction and addition is done in Hex.
1 | 4 | |||
C | 4 | F | E | D |
- | C | 4 | ||
3 | A | D | ||
- | 3 | 1 | 0 | |
0 | 9 | D |