
How to Convert Decimal to Hexadecimal with Step by Step Method and Examples
The concept of Decimal to Hex plays a key role in mathematics and is widely applicable to both real-life situations and exam scenarios. Learning how to convert decimal numbers (base-10) to hexadecimal (base-16) is especially helpful in competitive exams, computer science, and electronics.
What Is Decimal to Hex?
A Decimal to Hex conversion is the process of changing a number from the decimal system (which uses digits 0-9 and is based on powers of 10) to the hexadecimal system (which uses digits 0-9 and letters A-F, based on powers of 16). You’ll find this concept applied in areas such as base conversions, digital electronics, and coding/programming.
Key Formula for Decimal to Hex
Here’s the standard method:
Repeatedly divide the decimal number by 16. Each time, write down the remainder. The hexadecimal digits are the remainders read from last to first.
Cross-Disciplinary Usage
Decimal to hex is not only useful in Maths but also plays an important role in Physics, Computer Science, and daily logical reasoning. Students preparing for exams like JEE, Olympiads, NTSE, and technical interviews will also see its relevance in many questions. In coding, hexadecimal numbers are often used to specify memory addresses, error codes, or color values.
Step-by-Step Illustration
Let’s learn how to convert a decimal number to hex using simple steps. Follow the division-remainder method:
- Pick your decimal number. (Example: 789)
- Divide the number by 16. Write the quotient and the remainder.
789 ÷ 16 = 49, remainder = 5 - Now, divide the quotient again by 16. Write the new quotient and remainder.
49 ÷ 16 = 3, remainder = 1 - Repeat until your quotient is 0. (Here: 3 ÷ 16 = 0, remainder = 3)
- The hex number is the remainders read from last to first.
So, 789 in decimal = 315hex
Note: If you get a remainder of 10-15, you write them as A-F (10 = A, 11 = B, ..., 15 = F).
Decimal to Hex Table (1 to 32)
| Decimal (Base 10) |
Hexadecimal (Base 16) |
Decimal | Hexadecimal |
|---|---|---|---|
| 0 | 0 | 17 | 11 |
| 1 | 1 | 18 | 12 |
| 2 | 2 | 19 | 13 |
| 3 | 3 | 20 | 14 |
| 4 | 4 | 21 | 15 |
| 5 | 5 | 22 | 16 |
| 6 | 6 | 23 | 17 |
| 7 | 7 | 24 | 18 |
| 8 | 8 | 25 | 19 |
| 9 | 9 | 26 | 1A |
| 10 | A | 27 | 1B |
| 11 | B | 28 | 1C |
| 12 | C | 29 | 1D |
| 13 | D | 30 | 1E |
| 14 | E | 31 | 1F |
| 15 | F | 32 | 20 |
| 16 | 10 |
Speed Trick or Vedic Shortcut
If you are in a hurry, remember this trick: For numbers less than 16, decimal to hex is the same (0-15 = 0-F). For larger numbers, divide and use the remainder system as shown above. Memorising common hex values using the table is a quick way to save time in exams and coding rounds. Vedantu live classes often highlight such speed strategies for students.
Decimal to Hex in Python, Excel, and JavaScript
Programming languages make this process even faster. Here’s how:
- Python:
hex(789)→ returns '0x315' - Excel:
=DEC2HEX(789)→ returns 315 - JavaScript:
(789).toString(16)→ returns '315'
Try These Yourself
- Convert 65 to hexadecimal.
- Find the hex value of 255.
- Change 108 to base-16.
- Reverse: What is the decimal value of 1A hex?
Frequent Errors and Misunderstandings
- Reading remainders in the wrong order (always write from last to first step!)
- Confusing values above 9: Remember 10=A, 11=B, ..., 15=F.
- Skipping quotient/remainder when zero or not dividing fully.
Relation to Other Concepts
The idea of Decimal to Hex connects closely with decimal to binary conversion and the hexadecimal number system. Mastering this helps with understanding conversions in computer science and digital logic circuits. You can practise other number systems, such as binary, octal, and more, through Vedantu resources.
Classroom Tip
A quick way to remember hex values is to make a small flashcard: 0-9 as usual, and then 10=A, 11=B, ..., 15=F. Practice with random numbers to strengthen your skills! Vedantu’s teachers use plenty of visuals and quizzes to make these conversions easy for you.
We explored Decimal to Hex—from definition, conversion steps, tricks, common errors, and deep links with other topics and programming uses. Keep practicing and use Vedantu’s stepwise solutions and topic tables to become a base conversion pro!
Internal Links to Related Topics
FAQs on Decimal to Hex Conversion Explained with Steps
1. What is decimal to hex conversion?
Decimal to hex conversion is the process of converting a number from the base-10 (decimal) system to the base-16 (hexadecimal) system. In decimal, digits range from 0 to 9, while in hexadecimal, digits range from 0–9 and A–F (where A = 10, B = 11, ..., F = 15). This conversion is commonly used in computer science and digital electronics because hexadecimal is a compact way to represent binary numbers.
2. How do you convert decimal to hexadecimal step by step?
To convert a decimal number to hexadecimal, repeatedly divide the number by 16 and record the remainders.
- Step 1: Divide the decimal number by 16.
- Step 2: Write down the remainder (0–15).
- Step 3: Divide the quotient again by 16.
- Step 4: Repeat until the quotient becomes 0.
- Step 5: Write the remainders in reverse order to get the hexadecimal number.
3. What is the hexadecimal equivalent of a decimal number?
The hexadecimal equivalent of a decimal number is the representation of that number in base 16 using digits 0–9 and A–F. For example, the decimal number 26 converts as: 26 ÷ 16 = 1 remainder 10 (A), 1 ÷ 16 = 0 remainder 1 → Hexadecimal form is 1A. The result is obtained by reversing the remainders.
4. Why do we divide by 16 when converting decimal to hex?
We divide by 16 because hexadecimal is a base-16 number system. Each division by 16 determines the coefficients of powers of 16 (16⁰, 16¹, 16², ...). The remainder at each step gives the digit for that place value. This method works for any base conversion by dividing by the target base.
5. How do you convert large decimal numbers to hexadecimal?
To convert large decimal numbers to hexadecimal, use repeated division by 16 until the quotient becomes zero.
- Divide the number by 16.
- Record each remainder (convert 10–15 to A–F).
- Continue dividing the quotient by 16.
- Write the remainders in reverse order.
6. What is the formula for converting decimal to hexadecimal?
The formula for decimal to hexadecimal conversion expresses the number as a sum of powers of 16: N = a₀×16⁰ + a₁×16¹ + a₂×16² + .... Here, each coefficient aᵢ is a digit between 0 and 15. For example, 47 in decimal equals (2 × 16¹) + (15 × 16⁰), which is 2F in hexadecimal.
7. What is the difference between decimal and hexadecimal number systems?
The main difference is that decimal is a base-10 system while hexadecimal is a base-16 system.
- Decimal digits: 0–9
- Hexadecimal digits: 0–9 and A–F
- Place values in decimal: powers of 10
- Place values in hex: powers of 16
8. Can you give an example of decimal to hex conversion?
Yes, for example, converting decimal 100 to hexadecimal gives 64.
- 100 ÷ 16 = 6 remainder 4
- 6 ÷ 16 = 0 remainder 6
- Write remainders in reverse → 64
9. How do you convert decimal fractions to hexadecimal?
To convert a decimal fraction to hexadecimal, repeatedly multiply the fractional part by 16 and record the integer parts.
- Multiply the fraction by 16.
- Write down the whole number part.
- Repeat with the new fractional part.
10. What are common mistakes when converting decimal to hexadecimal?
Common mistakes in decimal to hexadecimal conversion include incorrect remainder handling and forgetting A–F values.
- Not reversing the remainders at the end.
- Writing 10–15 as numbers instead of A–F.
- Stopping division before the quotient becomes zero.
- Mixing up base-10 and base-16 place values.





















