# Hexadecimal to Decimal Conversion (with Fractional Part)

A number can be converted from hexadecimal to decimal by following the steps outlined in this post, using the corresponding formula, and referring to the accompanying example. But before we get started, let's take a moment to discuss the meaning of these two numbers.

• Hexadecimal number: The hexadecimal number system has a base of 16, therefore it allows 16 digits that can be used to create or form a hexadecimal number. For example: 23F, 43, and 23D4F0, etc.
In other words, a number that consists of 16 digits, which are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F, is considered to be a hexadecimal number. The characters A-F refer to 10–15. That is, A refers to 10, B refers to 11, and so on.
• Decimal number: On the other hand, the decimal number system has a base of 10. Therefore, it has a total of 10 digits, which are 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9, which can be used to form a decimal number. For example: 230, 409, and 23022, etc.

## Hexadecimal to Decimal Conversion Steps

It is necessary to adhere to the rules that are outlined in the following lists in order to convert any hexadecimal number into the decimal system:

1. Write down the given hexadecimal number.
2. Write down the weight for different positions.
3. To get the product, multiply each digit of the given hexadecimal number by the corresponding weight.
4. Now add all the products to get the decimal equivalent.

Now, let's look at an example and see how we can better understand it by applying the rules that were just discussed.

Now that we have a number written in hexadecimal, let's say it's 1D7F; we need to translate that number into its representation in decimal.

That is, (1D7F)16 = ( ? )10.

The table given below shows you how to apply the first three rules given above to convert hexadecimal to decimal:

 1 D or 13 7 F or 15 Given Number 163 162 161 160 Weight

After concentrating on the preceding table, apply rules 3 and 4, and we have

```= 1*163 + 13*162 + 7*161 + 15*160
= 4076 + 3328 + 112 + 15
= 7551```

which is the decimal equivalent of the given hexadecimal number, that is, 1D7F. Therefore, (1D7F)16 = (7551)10.

## Hexadecimal to Decimal Conversion Formula

Let's focus on the area that has been provided for us below, which explains how the hexadecimal number system can be converted into the decimal system. Consider the following scenario, in which the user has provided the hexadecimal input 5A9:

```5         A         9
162       161       160
(5*162)   (A*161)   (9*160)

= (5*162) + (10*161) + (9*160)
= 1280 + 160+9
= 1449```

As you can see from the above box:

• First, you have to write every hexadecimal digit.
• Then write 16 as the base and increment its exponent with 0, 1, 2, and so on from right to left below each and every hexadecimal digit.
• Write the multiplication of each hexadecimal digit with the corresponding powers of 16.
• Finally, add all the values as shown in the above box.

Therefore, when converting 5A9 into decimal, we get 1449. Therefore, (5A9)16 = (1449)10.

The rules presented above are only relevant for hexadecimal input that does not include a decimal point. Let's move on to the next step and learn how to convert numbers written in hexadecimal that contain fractional components into the corresponding value written in decimal.

## Hexadecimal (containing a decimal point) to Decimal Conversion

Here is another box that shows the conversion of hexadecimal (with a decimal point) to decimal. Let's suppose that the user has supplied 5A9.63 as hexadecimal input.

```5         A         9         6         3
162       161       160       16-1      162
(5*162)   (10*161)  (9*160)   (6*16-1)  (3*16-2)

= (5*162) + (10*161) + (9*160) + (6*16-1) + (3*16-2)
= 1280 + 160 + 9 + 0.375 + 0.01172
= 1449.3867```

#### Programs Created on Hexadecimal to Decimal Conversion

Computer Fundamentals Quiz

« Previous Tutorial Next Tutorial »

Liked this post? Share it!