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 to Hexadecimal Conversion Table

DecimalHexadecimal
11
22
33
44
55
66
77
88
99
10A
11B
12C
13D
14E
15F
1610
1711
1812
1913
2014
2115
2216
2317
2418
2519
261A
271B
281C
291D
301E
311F
3220
3321
3422
3523
3624
3725
3826
3927
4028
4129
422A
432B
442C
452D
462E
472F
4830
4931
5032
5133
5234
5335
5436
5537
5638
5739
583A
593B
603C
613D
623E
633F
6440
6541
6642
6743
6844
6945
7046
7147
7248
7349
744A
754B
764C
774D
784E
794F
8050
DecimalHexadecimal
8151
8252
8353
8454
8555
8656
8757
8858
8959
905A
915B
925C
935D
945E
955F
9660
9761
9862
9963
10064
10165
10266
10367
10468
10569
1066A
1076B
1086C
1096D
1106E
1116F
11270
11371
11472
11573
11674
11775
11876
11977
12078
12179
1227A
1237B
1247C
1257D
1267E
1277F
12880
12981
13082
13183
13284
13385
13486
13587
13688
13789
1388A
1398B
1408C
1418D
1428E
1438F
14490
14591
14692
14793
14894
14995
15096
15197
15298
15399
1549A
1559B
1569C
1579D
1589E
1599F
160A0
DecimalHexadecimal
161A1
162A2
163A3
164A4
165A5
166A6
167A7
168A8
169A9
170AA
171AB
172AC
173AD
174AE
175AF
176B0
177B1
178B2
179B3
180B4
181B5
182B6
183B7
184B8
185B9
186BA
187BB
188BC
189BD
190BE
191BF
192C0
193C1
194C2
195C3
196C4
197C5
198C6
199C7
200C8
201C9
202CA
203CB
204CC
205CD
206CE
207CF
208D0
209D1
210D2
211D3
212D4
213D5
214D6
215D7
216D8
217D9
218DA
219DB
220DC
221DD
222DE
223DF
224E0
225E1
226E2
227E3
228E4
229E5
230E6
231E7
232E8
233E9
234EA
235EB
236EC
237ED
238EE
239EF
240F0
DecimalHexadecimal
241F1
242F2
243F3
244F4
245F5
246F6
247F7
248F8
249F9
250FA
251FB
252FC
253FD
254FE
255FF
256100
257101
258102
259103
260104
261105
262106
263107
264108
265109
26610A
26710B
26810C
26910D
27010E
27110F
272110
273111
274112
275113
276114
277115
278116
279117
280118
281119
28211A
28311B
28411C
28511D
28611E
28711F
288120
289121
290122
291123
292124
293125
294126
295127
296128
297129
29812A
29912B
30012C
30112D
30212E
30312F
304130
305131
306132
307133
308134
309135
310136
311137
312138
313139
31413A
31513B
31613C
31713D
31813E
31913F
320140

Recent Comments
guity 2022-10-13 14:57:37

it is really helpfully always

Shubham 2022-05-06 06:02:17

140=8C
737=2E1
352=160
023=17
040=‬28

Sinjo 2022-02-15 14:36:15

Good one because to know the number system

Tom Minerd 2021-12-17 18:18:24

@JAVA N AR - I think you may be incorrect when stating that 13 in hex = 49 in decimal. You have it in reverse. 31 in hex is actually 49 in decimal. 13 is actually 19 in decimal as you have 1 in the 16s place (16 raised to the 1st power) and 3 in the ones place (16 raised to the 0 power).

JAVA N AR 2021-12-05 00:18:12

It is not like hexadecimals can't make up those numbers - obviously they can - the whole point of having a counting system is to count all the countables ( i.e how could you not be able to count something that you represent, even if you do it non-numerically, like in this case with numbers 10, 11, 12, 13, 14 and 15)!

But a number that you see as the number 10, 11, 12, 13, 14, 15 or 16 in a hexadecimal counting base is not the same number 10,11,12,13,14,15 or 16 that you see when you look at the decimal base counting table.

While both 13-s, for example, in a decimal and a hexadecimal systems contain same two digits, the digit 3 in the decimal base system represents the amount of 10-s raised to the power of 0, contained in the number, whereas the digit 3 in the hexadecimal base system represents the amount of 16-s raised to the power of 0. Thus, when reading a number 13 in the hexadecimal code, one can read it as a number that is equivalent to a decimal number equal to a TOTAL SUM of 3 packs of 16 raised to the 1-st power AND 1 pack of 16 raised to the 0-th power. Which, upon regular arithmetic calculation gives us the number equal to 3*1*16+1*1=3*16+1=48+1=49.

Therefore, the number 13 in a hexadecimal based world is not the number 13 in a our regular decimal based world, for the number 13 of our own dear decimal world is a letter D in a world of a hexadecimal count. AND, as we have just figured out, the number 13 of the hexadecimal world is a number 49 in the decimal one.

I hope that this clarifies the difference between using 13 as 1 digit, and having a number 13 as a combination of 2 digits.

Charan 2021-10-16 06:18:53

The hex value of 2.125 is 2.2. I'd like to know how this is calculated.

Susan Lambui 2021-10-13 23:59:19

How I calculate this octal number?
a.421+357=

Guest 2021-08-15 05:42:46

Such a useful website

wajid 2021-07-05 14:28:35

pls convert this 140,737,352,023,040‬ into hex

Crstn Lng 2021-06-17 06:19:17

Thx. Nice work ;-)

Czloweik 2021-06-16 23:44:00

(31)10 = (1F)16

lou8085 2021-03-08 07:07:14

Very useful website - thank you !

Guest 2021-02-25 19:14:40

how come the hexadecimal for 18, 19, etc is 12, 13 14... I thought that hexadecimals couldn't make those numbers? why isn't it 2A? Sorry just wondering!

Eugene Amoah 2021-01-29 12:27:16

why is that decimals can not be converted from base to numbers or figurs

Vytautas 2020-11-26 06:49:32

Nice explanation.
Useful tool in bash for such conversion (in other shells too, I guess):
printf '%x' ""
e.g.
printf '%xn' "501"
1f5

Guest 2020-11-05 09:36:33

Can give the full explanation of the Decimal number conversions to hexadecimal number. The Decimal number is 9108906440

Guest 2020-08-16 09:29:14

Very much useful and understanding

Guest 2020-08-02 09:33:31

nice explanation

Tom 2020-05-18 13:26:42

Awesome tool that every computer owner has to have. Thank You

Guest 2020-05-09 16:31:57

How to convert decimal to hex in Python

hex_num = hex(170)

Convert 170 to hexadecimal

print(hex_num)

Output

0xaa

Share Your Comments