Decimal to Hexadecimal Converter

To use this decimal to hex converter tool, you have to type a decimal value like 79 into the left field below, and then hit the Convert button. Therefore, you can convert up to 19 decimal characters (max. value of 9223372036854775807) to hex.


swap conversion: Hex to Decimal

Decimal to hex conversion result in base numbers

Decimal System

The decimal numeral system is the most commonly used and the standard system in daily life. It uses the number 10 as its base (radix). Therefore, it has 10 symbols: The numbers from 0 to 9; namely 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9.

As one of the oldest known numeral systems, the decimal numeral system has been used by many ancient civilizations. The difficulty of representing very large numbers in the decimal system was overcome by the Hindu–Arabic numeral system. The Hindu-Arabic numeral system gives positions to the digits in a number and this method works by using powers of the base 10; digits are raised to the nth power, in accordance with their position.

For instance, take the number 2345.67 in the decimal system:

Hexadecimal System (Hex System)

The hexadecimal system (shortly hex), uses the number 16 as its base (radix). As a base-16 numeral system, it uses 16 symbols. These are the 10 decimal digits (0, 1, 2, 3, 4, 5, 6, 7, 8, 9) and the first six letters of the English alphabet (A, B, C, D, E, F). The letters are used because of the need to represent the values 10, 11, 12, 13, 14 and 15 each in one single symbol.

Hex is used in mathematics and information technologies as a more friendly way to represent binary numbers. Each hex digit represents four binary digits; therefore, hex is a language to write binary in an abbreviated form.

Four binary digits (also called nibbles) make up half a byte. This means one byte can carry binary values from 0000 0000 to 1111 1111. In hex, these can be represented in a friendlier fashion, ranging from 00 to FF.

In html programming, colors can be represented by a 6-digit hexadecimal number: FFFFFF represents white whereas 000000 represents black.

How to Convert Decimal to Hex

Decimal to hexadecimal conversion can be achieved by applying the repeated division and remainder algorithm. Simply put, the decimal number is repeatedly divided by the radix 16. In between these divisions, the remainders give the hex equivalent in reverse order.

Here is how to convert decimal to hex step by step:

Now, let’s apply these steps to, for example, the decimal number (501)10

Step 1: As 501 is greater than 16, divide by 16. 
501 ÷ 16 = 31.3125
Step 2: To calculate the remainder, you need to multiply the part after the decimal point by 16.
0.3125 * 16 = 5
So the first remainder (and the least significant digit in hex) is 5.
Step 3: Divide 31 (the part of the quotient that is before the decimal point) by 16.
31 ÷ 16 = 1.9375
Step 4: Calculate the remainder.
0.9375 * 16 = 15
Step 5: Divide the integer part of the last quotient by 16.
1 ÷ 16 = 0.0625
Step 6: Calculate the remainder.
0.0625 * 16 = 1 
Step 7: The remainders written from below to top give you the hex values 1, 15 and 5.
Since 15 equals F in the hexadecimal numerals, (501)10 = (1F5)16

Decimal to Hex Conversion Examples

Example 1: (4253)10 = (109D)16

4253 ÷ 16 = 265.8125
0.8125 * 16 = 13 (Remainder 13, equivalent to D in hexadecimal)
265 ÷ 16 = 16.5625
0.5625 * 16 = 9 (Remainder 9)
16 ÷ 16 = 1 (Remainder 0) 
1 ÷ 16 = 0.0625 
0.00625 * 16: 1 (Remainder 1)

Read the remainders from the most significant to the least - from bottom to top: 109D.
109D the hex equivalent of (4253)10

Example 2: (16)10 = (10)16

16 ÷ 16 = 1 (Remainder 0)
1 ÷ 16 = 0.0625 
0.00625 * 16: 1 (Remainder 1)

Example 3: (45)10 = (2D)16

45 ÷ 16 = 2.8125 
0.8125 * 16 = 13 (Remainder 13, equivalent to D in hexadecimal)
2 ÷ 16 = 0.125
0.125 * 16 = 2 (Remainder 2)

Decimal Hex Conversion Chart

DecimalHexadecimal
00
11
22
33
44
55
66
77
88
99
10A
11B
12C
13D
14E
15F