Hex to decimal converter

Hex to decimal converter



Hex to decimal converter or short hex to dec converter is a nice online tool that helps you to convert numbers expressed in the hexadecimal (hex) format to the decimal (dec) format. The hex to decimal converter tool is very useful especially for web developers as they often need to convert from hex to dec and the other way around.

Hex to decimal converter

To convert hex to dec, you are welcome to use our hex to dec converter. The hex to decimal converter (convertor) provided below is based on a simple JavaScript and works three ways. You can enter hex number in the first box, hit TAB on your keyboard (or click outside the box) and get the corresponding value in decimal and binary. You can also enter the decimal value and get the corresponding hex value. Or, you can also click the checkboxes to inpur binary and retrieve hex and dec.

Enter hexadecimal (Hex) and hit TAB or click outside the box:

(Note, numbers between Hex 0000 and Hex FFFF may be converted.)

Two bytes of binary (16 bits):

Decimal:   32768 16384 8192 4096   2048 1024 512 256   128 64 32 16   8 4 2 1
Binary:        
   215   214   213   212     211   210   2   2     2   2   2   2     2   2   2   2 

Enter decimal (Dec) and hit TAB or click outside the box:

(Note, numbers between Dec 0 and Dec 65535 may be converted.)

Nice hex to dec tool isn't it? This hex to dec converter works in reverse order as well. To convert from binary, enter ones by clicking the small check boxes. To convert from decimal, enter the number in the appropriate box, and then click outside the box. If you need to convert large decimal numbers, you might want to take a look at our Dec to hex converter.

How do these numbers translate to colors? Every color is composed of red, green, and blue. Each flavor of these color can be expressed in decimal or hexadecimal numbers. If you mix three decimal or hexadecimal numbers, you get a color. How does it work? Take a look at our RGB color picker.

How the hex to dec converter and hex to dec conversion works

The hex to decimal conversion and the logic behind the hex to decimal converter (hex to dec converter) is pretty simple. Converting hex to dec is a two step process in which you first convert from hex to binary and then from binary to decimal.

Let's demonstrate the hex to dec conversion using an example. We will convert hexadecimal number E7. Hex number E7 is a one byte (8 bits) number. E can be expressed with 4 bits and 7 can be expressed with another 4 bits. Take a look at the following print screen:

Hex to decimal converter

Why does hexadecimal E equal to binary 1110, and why hexadecimal 7 equals to binary 0111? That is how it has been defined, that is how it works, and this relationship can be seen in the following Hex to decimal conversion table.

Hex to decimal conversion table
HEX0123456789ABCDEF
DECIMAL0123456789101112131415
BINARY0000000100100011010001010110011110001001101010111100110111101111

Ok, so far we know that the hexadecimal E7 translates to binary 11100111. Now, how do we convert this to decimal? This step in the hex to decimal conversion process is as easy as the previous hex to binary step.

From a table provided and explained on the dec to hex converter page (see the Dec to Hex and Bin conversion table (expanded above 4 bits)), we know that the first 1 in our example binary 11100111 equals to decimal 27 that is decimal 128. The second 1 in 11100111 equals to decimal 26 that is 64. The third 1 in 11100111 equals to decimal 25 that is decimal 32.

As we are deciphering the whole byte, we need to add all numbers up. In our case, all the ones result in 128 + 64 + 32 + 4 + 2 + 1 which equals to 231. Thus, we came to a conclusion using our hex to decimal converter based on the hex to dec conversion process that hexadecimal E7 equals to binary 11100111 and that equals to decimal 231.

You can see this binary to decimal conversion in the following picture:

hex to dec converter

In case you have any questions about the hex to dec conversion process, you can ask questions in our discussion forum.

Hex to decimal converter using PHP

There is a function in PHP that can do the hex to dec conversion if you need it for some calculations. The name of the hex to dec conversion function is hexdec(), and the following example shows how it is used:

<?php
echo hexdec(E7) . "\n";
?>

Hex to dec converter in PHP is much easier than hec to dec conversion in JavaScript.

Anything else besides the hex to dec converter?

Of course, we have a lot of other interesting stuff besides the hex to decimal converter.

Dec to hex converter
ASCII to hex converter
RGB color picker
Browser safe colors
How to blur text or image
Decimal to binary converter
Word letter mixer (disorganizer)
How to create Favicon

Have a good day.

.

Discuss this article or this topic in our discussion forum:
(The table bellow shows a list of 8 most recent topics posted in our discussion forum. Visit our discussion forum to see more. It is possible the links below are not related to this page, but you can be certain you will find related posts in the discussion forum. You can post one yourself too.)
Email this article to a friend:
TO: 
FROM: 
2 + 6 - 3 = 
.
How can I link to this web page?

It is easy, just include the code provided below into your HTML code.

<a href="http://www.maxi-pedia.com/hex+to+decimal+converter" title="www.Maxi-Pedia.com: Hex to decimal converter" target="_blank">Hex to decimal converter</a>
.