Skip to the content

Decimal to Hex Converter

Turn a decimal number into hexadecimal, with each division by 16 and its remainder shown.

Type a decimal number in the first field and read it in hexadecimal in the second. It works the other way round as well. Whole numbers only; spaces, underscores and the prefixes 0b, 0o and 0x are fine.

Working

DivisionResultRemainder
2024 ÷ 161268
126 ÷ 16714 = E
7 ÷ 1607

The remainders from the last to the first: 7E8

Other bases

from 2 to 36
Bit length
11 bits
Fits in
2 bytes
Share this tool:TwitterFacebookLinkedInWhatsAppEmail

How to convert decimal to hexadecimal by hand

Divide the number by 16 and note the remainder. Do the same with the result, until the result is 0. A remainder from 10 to 15 is written as a letter: 10 is A, 11 is B, 12 is C, 13 is D, 14 is E and 15 is F.

The last remainder is the first digit. For 2024: 2024 ÷ 16 = 126 remainder 8, then 126 ÷ 16 = 7 remainder 14, then 7 ÷ 16 = 0 remainder 7. From the last to the first that is 7, E and 8, so the answer is 7E8.

The working under the two fields at the top of the page does this for whatever number you type.

Good to know

  • To check an answer, work it back: 7 × 256 + 14 × 16 + 8 = 2024.
  • Numbers up to 255 need at most two hex digits. In bytes and colour codes a single digit gets a zero in front, so 10 is written 0A.
  • In program code a hexadecimal number is marked with 0x, as in 0x7E8, so that a number like 10 cannot be mistaken for ten. In hexadecimal, 10 is sixteen.

Decimal to hexadecimal table

DecimalHexadecimal
00
11
22
33
44
55
66
77
88
99
10A
11B
12C
13D
14E
15F
1610
DecimalHexadecimal
2014
3220
5032
6440
10064
1277F
12880
200C8
255FF
256100
5001F4
512200
10003E8
1024400
40961000
65535FFFF

The number base converter shows binary, octal, decimal and hexadecimal next to each other, and explains positional notation and two's complement.

See all 9