How to convert from hex to dec ?

  • Thread starter tinhnho
  • Start date
  • Tags
    Convert
In summary, hexadecimal has 16 symbols and the digits on the right represent the one's, sixteen's, 256's, and 4096's place. To convert to decimal, multiply each digit by its corresponding power of 16 and add the results together. An online converter can be used to double check the accuracy of your calculations.
  • #1
tinhnho
21
0
edited..thanks for your help
 
Last edited:
Mathematics news on Phys.org
  • #2
First, note that hexadecimal has 16 symbols (0-9, followed by 'A,' equal to decimal 10, through 'F,' equal to decimal 15).

The first digit on the right is the one's place. Take whatever number is in that position, and multiply it by one.

The next digit, second from the right, is the sixteen's place. Take whatever numer is that position, and multiply it by 16.

The next digit, thrid from the right, is the 256's place. (256 = 16^2.) Take whatever number is in that position, and multiply it by 16.

The next digit, fourth from the right, is the 4096's place (4096 = 16^3.) Take whatever number is in that position, and multiply it by 4096.

Add the result of all those multiplications, and you have the number in decimal.

- Warren
 
  • #3
here what i have for Hex 30500000 => Dec = 1052672

(16^3 + 16^5= 1052672)

my result seem doesn't right !:confused:

I confuse, would you give a example by number instead by words? Don't need to be exacted those hex number above, any number would fine with me, i will follow from there and try to undestand. Again thanks for your explanation.
 
  • #4
nevermind, i think i got it

here what i did 0x1 + 0x16 +0x(16^2) + 0x(16^3) +0x(16^4) +5x(16^5) +0x(16^6) +3x(16^7) =810549248

the result matchs with the calculator. thanks :)
 
Last edited:
  • #5
tinhnho said:
here what i have for Hex 30500000 => Dec = 1052672

(16^3 + 16^5= 1052672)

my result seem doesn't right !:confused:

I confuse, would you give a example by number instead by words? Don't need to be exacted those hex number above, any number would fine with me, i will follow from there and try to undestand. Again thanks for your explanation.

The answer should be:

0 + 0*162 + 0*163 + 0*164 + 0*165 + 5*166 + 0*167 + 3*168 = 12968787968
 
  • #6
Oops I lost a digit disregard my last post.
 
  • #7
Hi guys,
In case you want to double check your results, use this http://www.stringfunction.com/hex-decimal.html"
Hope this can help
David
 
Last edited by a moderator:

1. What is the difference between hex and dec?

Hexadecimal (hex) and decimal (dec) are two different number systems used to represent numbers. Hex uses 16 symbols (0-9 and A-F) while dec uses 10 symbols (0-9). Hex is commonly used in computer programming and digital systems, while dec is used in everyday life.

2. How do I convert a hex number to a dec number?

To convert from hex to dec, you can use the following formula: d = (16^0 * h1) + (16^1 * h2) + (16^2 * h3) + ... + (16^n * hn), where d is the decimal number and h is the hex number. Simply replace the h values with their corresponding decimal values and solve the equation.

3. Can I use a calculator to convert from hex to dec?

Yes, most calculators have a function to convert from hex to dec. Look for a button or option labeled "HEX" or "DEC" and follow the instructions on your calculator to convert the number.

4. Are there any online tools that can convert hex to dec?

Yes, there are many online converters available that can quickly and easily convert hex to dec. Simply search for "hex to dec converter" and choose one from the results. Make sure to double check the accuracy of the conversion.

5. How do I convert a hex color code to a dec color code?

To convert a hex color code (such as #FF0000 for red) to a dec color code, simply break up the hex code into its three components (RR, GG, BB) and convert each one separately using the formula mentioned in question 2. Then, combine the converted numbers to form the dec color code (e.g. 255, 0, 0 for #FF0000).

Similar threads

Replies
4
Views
637
Replies
2
Views
682
  • Engineering and Comp Sci Homework Help
Replies
3
Views
873
Replies
1
Views
934
Replies
17
Views
2K
Replies
4
Views
2K
Replies
1
Views
3K
Replies
3
Views
2K
Replies
5
Views
1K
Replies
4
Views
1K
Back
Top