Home Conversion Number Decimal to Hex

Decimal to Hex Converter

To use decimal to hexadecimal converter, type a decimal value e.g. "120" and click on the Convert button and you will get the hexadecimal value of "78" on the right hand side.

Decimal to Hex Conversion:

Hexadecimal = 78

Decimal Numeral System

Decimal numbers is a base-10 number system built from ten characters: 0 to 9. The system assigns value through place, whole-number positions represent powers of 10 that increase to the left (...., 102, 101, 100) and fractional positions represent negative powers that extend to the right (10-1, 10-2, 10-3, ....). This way, numbers of nearly any magnitude, large or small, can be written compactly.

Example:

Let's assume a decimal value "5743.19",

Digit Position Power of 10 Value
5 103 (Thousands place) 103 = 1000 5 × 1000 = 5000
7 102 (Hundreds place) 102 = 100 7 × 100 = 700
4 101 (Tens place) 101 = 10 4 × 10 = 40
3 100 (Ones place) 100 = 1 3 × 1 = 3
1 10-1 (Tenths place) 10-1 = 0.1 1 × 0.1 = 0.1
9 10-2 (Hundredths place) 10-2 = 0.01 9 × 0.01 = 0.09

Total = (5 × 103) + (7 × 102) + (4 × 101) + (3 × 100) + (1 × 10-1) + (9 × 10-2) = 5000 + 700 + 40 + 3 + 0.1 + 0.09 = 5743.19

Hexadecimal Numeral System (Hex Numbers)

Hexadecimal numbers, often called hex numbers, are based on the number 16. The hexadecimal system, or base-16 numeral system, employs 16 distinct symbols: the decimal digits "0" through "9" and the first six letters of the English alphabet, "A" to "F." These letters correspond to the decimal values 10 through 15. Hex numbers are widely utilized in mathematics, computer science, and various scientific disciplines. Every hex digit represents a power of 16. The rightmost hex digit corresponds to the position 160 and the next left digit represents 161 and so on. For fractional hex values, after the hexadecimal point, the hex positions are incremented in negative powers to the right side e.g. 16-1, 16-2 and so on

Example:

Hex value "6AF4" can be written as,

Digit Position Power of 16 Value
6 163 (4096's place) 163 = 4096 6 × 4096 = 24576
A (10) 162 (256's place) 162 = 256 10 × 256 = 2560
F (15) 161 (16's place) 161 = 16 15 × 16 = 240
4 160 (1's place) 160 = 1 4 × 1 = 4

Therefore (6AF4)16 = (6 × 163) + (10 × 162) + (15 × 161) + (4 × 160) = 24576 + 2560 + 240 + 4 = (27380)10

How to Convert Decimal to Hex

To convert decimal to hexadecimal value, division and remainder algorithm is used where the decimal value is repeatedly divided by radix 16 to fetch the hexadecimal results. Consider the following steps convert decimal to hex. Follow the following steps:

How to Convert Fractional Decimal Part to Hex

The fractional decimal value can be converted to hex using the following steps:

Decimal to Hex Examples

Example 1: Convert (47)10 decimal value to hex value.

Division by 16 Quotient Remainder (Decimal) Remainder (Hex) Digit Position
47/16 2 15 F 160
2/16 0 2 2 161
  • Combine together all the remainder values in hex starting from last value to the first one. Final hex value is:
  • (47)10 = (2F)16
  • Example 2: Convert (571)10 decimal value to hex value.

    Division by 16 Quotient Remainder (Decimal) Remainder (Hex) Digit Position
    571/16 35 11 B 160
    35/16 2 3 3 161
    2/16 0 2 2 162
  • Hex value is:
  • (571)10 = (23B)16
  • Example 3: Convert (97898)10 to hex.

    Division by 16 Quotient Remainder (Decimal) Remainder (Hex) Digit Position
    97898/16 6118 10 A 160
    6118/16 382 6 6 161
    382/16 23 14 E 162
    23/16 1 7 7 163
    1/16 0 1 1 164
  • Hex value is:
  • (97898)10 = (17E6A)16
  • Example 4: Convert (97585.375)10 to hex.

  • Integer Part (97585):
  • Division by 16 Quotient Remainder (Decimal) Remainder (Hex) Digit Position
    97585/16 6099 1 1 160
    6099/16 381 3 3 161
    381/16 23 13 D 162
    23/16 1 7 7 163
    1/16 0 1 1 164
  • Fractional Part (0.375):
  • Multiplication by 16 Product Integer Part (Decimal) Integer Part (Hex) Fractional Remainder Digit Position
    0.375 × 16 6.0 6 6 0 16–1
  • Hex value is:
  • (97585.375)10 = (17D31.6)16
  • Example 4: Convert (31321.64453125)10 to hex.

  • Integer Part (31321):
  • Division by 16 Quotient Remainder (Decimal) Remainder (Hex) Digit Position
    31321/16 1957 9 9 160
    1957/16 122 5 5 161
    122/16 7 10 A 162
    7/16 0 7 7 163
  • Fractional Part (0.64453125):
  • Multiplication by 16 Product Integer Part (Decimal) Integer Part (Hex) Fractional Remainder Digit Position
    0.64453125 × 16 10.3125 10 A 0.3125 16–1
    0.3125 × 16 5.0 5 5 0 16–2
  • Hex value is:
  • (31321.64453125)10 = (7A59.A5)16
  • Frequently Ask Questions: Decimal to Hex Conversion

    Q1: Which decimal fractions can be exactly represented in hexadecimal?

    Only fractions that are multiples of powers of 1/16 can be precisely converted to hex values. For example, assume the fraction is 1/16, take its multiples:

    Now if we increase the power of base 16 to 2 in the denominator i.e. 1/162.Now takes its multiples and convert to hex:

    Q2: Convert -45 decimal to 8-bit hexadecimal using two’s complement?

    (45)10 = (2D)16 = (0010 1101)2

    Take two's complement (Invert all bits + Add 1):

    Inverted Bits: (1101 0010)2

    Add 1: (1101 0011)2 = (D3)16

    Therefore using 2's complement (-45)10 = (D3)16

    Q3: How to Convert decimal fraction 0.5625 to hex?

    Multiply the fraction 0.5625 × 16 = 9, Therefore integer = 9, remainder = 0. This value "9" is based at position 16-1, (0.5625)10 = (0.9)16

    Q4: Why do we convert decimal values to hex?

    Hexadecimal values more compact, human-readable, and directly compatible with binary. It is widely used in computing, electronics, networking, and programming. Memory addresses, color codes, MAC addresses etc. are often represented in hex values.

    Q5: Convert 65535 to hexadecimal?

    Hexadecimal: (65535)10 = (FFFF)16

    Decimal to Hexadecimal 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

    by Wasim Khan and it was last modified on

    Related Conversions

    Please find the related numeric conversions.