Convert Decimal to Hex

To convert Decimal to Hexadecimal, input decimal value in the box below, and then click on the big blue button that says “CONVERT TO HEX” and Hex is generated, copy it or you can download output file.

Copied to Clipboard.

Decimal Numbering System

In decimal number system there only ten (10) digits from 0 to 9. Every number (value) in this decimal system represents with 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9. The base of this number system is 10, because it has only 10 digits.

Example: 8062 in decimal (base 10)

806210 = (8 x 103) + (0 x 102) + (6 x 101) + (2 x 100)

Hexadecimal Number System

In a Hexadecimal number system there are sixteen (16) alphanumeric values from 0 to 9 and A to F. In this number system every number (value) represents with 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E and F. The base of this number system is 16, because it has 16 alphanumeric values. Here A is 10, B is 11, C is 12, D is 14, E is 15 and F is 16.

Example: What is 0xA5 in base 10?

0xA5 = A516 = (10 x 161) + (5 x 160) = 16510

Decimal-to-hexadecimal Conversion

  • Step 1: To convert a decimal number into hexadecimal, first you have to check whether the number in question is greater the 16 or not. If the number is less than 16 then we will have to use A, B, C, D, E and F for the numbers 10, 11, 12, 13, 14 and 15 respectively. For example.

  • Step 2: If the number is greater than 16 then divide the number in question by 16.

  • Step 3: Note down the remainder.

  • Step 4: Divide the quotient by 16 again and note down the remainder.

  • Step 5: Repeat the steps until you your quotient is less than 16.

  • Step 6: Note down the remainder from step 2 to 6.

  • Step 7: The column of the remainder is read in reverse order i.e., from bottom to top order. We try to discuss the method with an example.


Example 1: Convert (348)10 into a hexadecimal number.

Solution:

Division Quotient Generated Remainder
348/16 21 12 (C)
21/15 1 5
1/16 0 1

Hence the converted hexadecimal number is (15C)16.


Example 2: Covert (4768)10 into a hexadecimal number.

Solution:

Division Quotient Generated Remainder
4768/16 298 0
298/15 18 10 (A)
18/16 1 2
1/16 0 1

Hence the converted hexadecimal number is (12A0)16.


Decimal Hex Conversion Chart

Decimal Hexadecimal
0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
10 A
11 B
12 C
13 D
14 E
15 F



Hexadecimal Numbers are commonly used in computer programming to simplify the binary numbering system. As 16 is equivalent to 24, there is a linear relation between binary and hexadecimal number system. This means four binary digits are equivalent to one hexadecimal digit. But computers understand just 0 and 1 i.e. Binary number system so computers use just binary number system while humans use hexadecimal number system to shorten binary digits to make them understandable easily. Following are the fewer applications of Hexadecimal Number system:

To define colors on web pages: To define a color on any web page we use RGB where R stand for Red, G for Green ad B for Blue in the format of #RRGGBB.

To allocate memory: We can characterize every byte just as two hexadecimal digits where as we have to use 8 digits while using binary.

To represent MAC address: Media Access control (MAC) addresses consist of 12 Hexadecimal digits in the format of MM:MM:MM:SS:SS or MMMM-MMSS-SSSS. Here, the first six digits shows the identity of the manufacturer while the last 6 shows the serial number.