A decimal to hexadecimal conversion calculator changes a regular base 10 number into its base 16 equivalent. Enter any decimal number and the calculator returns the matching hexadecimal value right away, along with the manual steps behind that result. Hexadecimal numbers show up constantly in programming, web design color codes, and computer memory, which is why a quick, accurate conversion tool is useful for students, developers, and anyone else working with computers.
What Are the Decimal and Hexadecimal Number Systems?
Decimal is the number system most people use every day. It has a base of 10, built from the ten digits 0 through 9. Each position in a decimal number represents a power of 10. Take 653 as an example. It breaks down into 6×10² + 5×10¹ + 3×10⁰, or 600 + 50 + 3.
Hexadecimal works the same way but with a base of 16 instead of 10. Since a base 16 system needs 16 unique symbols and there are only ten digits available, the letters A through F step in to represent the values 10 through 15. Using the same place value logic, the hex number 62C breaks down into 6×16² + 2×16¹ + 12×16⁰, which equals 1536 + 32 + 12, or 1580 in decimal.
Number | Digit Breakdown | Calculation | Result |
653 (decimal) | 6, 5, 3 | 6×10² + 5×10¹ + 3×10⁰ | 653 |
62C (hex) | 6, 2, C(12) | 6×16² + 2×16¹ + 12×16⁰ | 1580 (decimal) |
Once you can read place values this way, converting between the two systems becomes a matter of following a consistent process rather than memorizing anything.
What Decimal Value Does Each Hexadecimal Digit A Through F Represent?

Six of the sixteen hexadecimal symbols are letters instead of numbers: A, B, C, D, E, and F. Each one stands in for a two digit decimal value that a single character couldn't otherwise represent.
Hex Digit | Decimal Value |
A | 10 |
B | 11 |
C | 12 |
D | 13 |
E | 14 |
F | 15 |
A common point of confusion is treating a hex number as if it were decimal. Hex 13 is not the same value as decimal 13. In hex, the 1 sits in the sixteens place and the 3 sits in the ones place, so hex 13 works out to (1×16) + 3, which equals 19 in decimal. The reverse mix up happens too. Decimal 31 does not become hex 31, it becomes hex 1F, since 31 divided by 16 leaves a quotient of 1 and a remainder of 15, and 15 is written as F. Keeping the two systems separate in your head, even when the digits look identical, avoids one of the most repeated mistakes people make with hex.
How Do You Convert a Whole Decimal Number to Hex Using the Division by 16 Method?

The most common way to convert a whole decimal number to hex is repeated division by 16. Divide the decimal number by 16, write down the remainder, then take the integer part of the quotient and divide that by 16 again. Keep repeating until the quotient reaches 0. The hex value is the collection of remainders, read from the last one calculated back to the first.
Example 1: Convert 960 to hex.
Division | Quotient | Remainder | Hex Digit |
960 ÷ 16 | 60 | 0 | 0 |
60 ÷ 16 | 3 | 12 | C |
3 ÷ 16 | 0 | 3 | 3 |
Reading the remainders from bottom to top gives 3, C, 0. So 960 in decimal equals 3C0 in hex.
Example 2: Convert 7562 to hex.
Division | Quotient | Remainder | Hex Digit |
7562 ÷ 16 | 472 | 10 | A |
472 ÷ 16 | 29 | 8 | 8 |
29 ÷ 16 | 1 | 13 | D |
1 ÷ 16 | 0 | 1 | 1 |
Reading bottom to top gives 1, D, 8, A. So 7562 in decimal equals 1D8A in hex.
The step that trips people up most is forgetting to reverse the order of the remainders at the end. The first remainder calculated is actually the last digit of the hex number, not the first.
How Do You Convert Decimal to Hex Using the Powers of 16 Method?
There is a second way to reach the same result that some calculators use instead of repeated division. Rather than dividing down, you work from the largest power of 16 that fits into the number and subtract your way down from there.
Example: Convert 1500 to hex.
Step 1: 16² equals 256. It fits into 1500 five times (5 × 256 = 1280).
Step 2: 1500 minus 1280 leaves 220.
Step 3: 16¹ equals 16. It fits into 220 thirteen times (13 × 16 = 208), and 13 in hex is D.
Step 4: 220 minus 208 leaves 12, which sits in the 16⁰ place as C.
Putting the digits together gives 5, D, C, so 1500 in decimal equals 5DC in hex. This method and the division method always produce the same answer. Which one to use is mostly a matter of preference, though the powers of 16 method can feel more intuitive once you are comfortable with place value.
How Do You Convert the Fractional Part of a Decimal Number to Hex?

Numbers with a decimal point need an extra step. The whole number part is converted using the division method above, and the fractional part is converted separately using multiplication.
To convert a fraction, multiply it by 16. The whole number portion of the result becomes the next hex digit after the point, and the fractional portion left over gets multiplied by 16 again. This repeats until the fraction reaches zero or you have enough digits for your purposes.
Example: Convert 7803 to hex, including the remainder that carries through each division.
Division | Quotient | Remainder | Hex Digit |
7803 ÷ 16 | 487 | 11 | B |
487 ÷ 16 | 30 | 7 | 7 |
30 ÷ 16 | 1 | 14 | E |
1 ÷ 16 | 0 | 1 | 1 |
Reading bottom to top gives 1E7B, so 7803 in decimal equals 1E7B in hex.
A frequently asked question involves why 2.125 in decimal becomes 2.2 in hex. The whole number 2 stays as 2. The fraction 0.125 equals one eighth. In hex, two tenths, written as .2, also equals one eighth, since 2 ÷ 16 = 0.125. That is the entire explanation. The fraction lines up exactly, it just looks unfamiliar because we are used to reading fractions in base 10.
How Do You Convert a Negative Decimal Number to Hex Using Two's Complement?
Negative decimal numbers can be shown in hex in two different ways. The simple approach just adds a minus sign in front of the positive hex value, the same way you would write a negative decimal number. Computers, however, do not use a minus sign internally. They use a method called two's complement, which represents negative numbers using only 0s and 1s.
Two's complement depends on a chosen bit width, commonly 8, 16, 32, or 64 bits. The same negative decimal number produces a different hex result depending on which bit width is selected, because the calculation works by adding a fixed power of two based on that width before converting to hex. This is why many calculators show two separate results side by side for a negative number, a plain signed hex value and a two's complement hex value for a specific bit width.
The full bit by bit method for working this out by hand, including how to flip bits and add one, is covered in more detail on the two's complement calculator on this site.
What Does a Full Decimal to Hexadecimal Conversion Table Look Like?

For quick lookups, having decimal and hex values side by side is often faster than running a calculation by hand. The table below covers 0 through 31, plus a set of round numbers that come up often in practice.
Decimal | Hex | Decimal | Hex | Decimal | Hex | Decimal | Hex |
0 | 0 | 8 | 8 | 16 | 10 | 24 | 18 |
1 | 1 | 9 | 9 | 17 | 11 | 25 | 19 |
2 | 2 | 10 | A | 18 | 12 | 26 | 1A |
3 | 3 | 11 | B | 19 | 13 | 27 | 1B |
4 | 4 | 12 | C | 20 | 14 | 28 | 1C |
5 | 5 | 13 | D | 21 | 15 | 29 | 1D |
6 | 6 | 14 | E | 22 | 16 | 30 | 1E |
7 | 7 | 15 | F | 23 | 17 | 31 | 1F |
Milestone values that come up often in practice:
Decimal | Hex |
40 | 28 |
50 | 32 |
64 | 40 |
80 | 50 |
100 | 64 |
128 | 80 |
200 | C8 |
255 | FF |
256 | 100 |
512 | 200 |
1000 | 3E8 |
2000 | 7D0 |
What Are Solved Examples of Converting Different Sized Decimal Numbers to Hex?
Seeing the same method applied at different scales makes it easier to trust the process. Here are three fully worked examples, small, medium, and large.
Small number: 49 to hex.
Division | Quotient | Remainder | Hex Digit |
49 ÷ 16 | 3 | 1 | 1 |
3 ÷ 16 | 0 | 3 | 3 |
Result: 49 in decimal equals 31 in hex.
Medium number: 1228 to hex.
Division | Quotient | Remainder | Hex Digit |
1228 ÷ 16 | 76 | 12 | C |
76 ÷ 16 | 4 | 12 | C |
4 ÷ 16 | 0 | 4 | 4 |
Result: 1228 in decimal equals 4CC in hex.
Large number: 35631 to hex.
Division | Quotient | Remainder | Hex Digit |
35631 ÷ 16 | 2226 | 15 | F |
2226 ÷ 16 | 139 | 2 | 2 |
139 ÷ 16 | 8 | 11 | B |
8 ÷ 16 | 0 | 8 | 8 |
Result: 35631 in decimal equals 8B2F in hex.
What Settings and Features Does a Decimal to Hex Calculator Typically Offer?
Beyond the basic input and output field, most decimal to hex calculators include a few extra settings worth knowing about.
Bit range or digit range: this setting, often adjustable between 8 and 64 bits, controls how signed and two's complement values are displayed and calculated. Choosing a wider bit range changes how negative numbers are represented, as covered earlier.
Digit grouping: long hex or binary outputs are easier to read when they are broken into small groups, similar to how a long decimal number gets separated by commas.
Signed two's complement field: many calculators display this alongside the plain hex result, so both the unsigned and signed interpretation of the same input are visible without running a second calculation.
Binary output: some tools also show the equivalent binary number next to the hex result, which is useful for double checking a conversion or for anyone who needs both formats at once.
What Mistakes and Confusions Do People Have When Converting Decimal to Hex?

Misreading a hex digit sequence as if it were decimal. Hex 13 equals decimal 19, not 13, because place value in hex works in powers of 16.
Forgetting to reverse the remainders. The division method produces digits from least significant to most significant, so the final answer has to be read backward.
Stopping a fractional conversion at the wrong point. Some fractions never reach zero, and the conversion has to be cut off at a chosen number of digits rather than expected to terminate cleanly.
Choosing the wrong bit width for a negative number. A two's complement result changes depending on whether 8, 16, 32, or 64 bits is selected, so mismatched settings produce a hex value that looks wrong even when the underlying math is correct.
Where Else Is Hexadecimal Used Beyond Basic Number Conversion?
Decimal to hex conversion is the foundation, but hex shows up in several other corners of computing once you know how to read it. It gets used directly in arithmetic, it sits alongside binary and octal as one of several ways to represent the same value, it defines colors on nearly every website, it can stand in for readable text, it appears throughout programming languages, and it is a standard way to describe memory addresses and network configurations. Each of these builds on the same place value idea covered above, just applied to a slightly different situation.
How Do You Add, Subtract, Multiply, and Divide Hexadecimal Numbers?
Hex numbers can be used in arithmetic the same way decimal numbers are, except carrying and borrowing happen in groups of sixteen instead of groups of ten. For instance, adding B and 8 in hex works out to 19 in decimal, which is 13 in hex, so a 1 carries into the next column just like it would in decimal addition once you pass 9.
Working through subtraction, multiplication, and division in hex follows similar logic but takes more practice to do by hand. The hex calculator on this site walks through addition, subtraction, multiplication, and division with a full multiplication table, if you want to try complete arithmetic problems in hex directly.
How Do You Convert a Decimal Number to Binary?
Binary is base 2, and it follows the exact same division remainder logic used for hex, just dividing by 2 at each step instead of 16. There is also a direct shortcut between the two number systems. Every single hex digit corresponds to exactly four binary digits, known as a nibble. Take the number 96 as an example. In hex it is 60, and in binary it is 1100000, made up of two nibbles, 0110 and 0000.
For a version of that same process worked out step by step in base 2, the decimal to binary converter covers it in detail.
How Do You Convert a Decimal Number to Octal?
Octal is base 8, and it is converted the same way as hex and binary, by dividing repeatedly, this time by 8. It is not used nearly as often today, but it still turns up in some legacy systems and in file permission settings on Unix based operating systems, where permissions are commonly written as three digit octal numbers such as 755.
For the full method and a working tool, the decimal to octal converter breaks down the same division process using base 8.
How Do You Convert a Hexadecimal Number Back to Decimal?
Reversing the process is more straightforward than converting forward. Multiply each hex digit by the power of 16 that matches its position, then add the results together. For example, hex 3B equals (3×16) + 11, which comes out to 59 in decimal.
This is also a useful way to double check a decimal to hex conversion. If you are not sure a result is correct, the hex to decimal converter lets you run the number back through in the opposite direction to confirm it matches.
How Are Hexadecimal Codes Used to Represent Colors in Web Design?
Website and app colors are almost always written as six digit hex codes, where FFFFFF represents white and 000000 represents black. Each pair of digits in the code stands for the red, green, and blue components of the color, each measured on a 0 to 255 decimal scale. A decimal value of 255 for full red, for instance, becomes FF in hex, giving codes like FF0000 for pure red.
If you are working with color values directly rather than single numbers, the RGB to hex converter handles that exact conversion for full colors.
How Do You Convert Hexadecimal Values to ASCII Text?
Hex is not only used for numbers, it can also represent readable text. Each pair of hex digits corresponds to one ASCII character code. For example, hex 41 represents the decimal value 65, which is the letter A in the ASCII table.
For converting longer strings of text or hex back and forth, the hex to ASCII text converter handles full words and sentences rather than single characters.
How Do Programming Languages Convert Decimal Numbers to Hex?
Most programming languages include a built in way to convert a decimal integer to hex without doing the math by hand. Python has a hex() function, JavaScript uses toString(16), C and several other languages support a %x format specifier in printf style output, and even a basic bash command line accepts printf '%x' to do the same job.
Code will often show hex numbers with a 0x prefix, such as 0x1F5, specifically so there is no ambiguity about which number system is being used. A full breakdown of decimal to hex conversion across Python, JavaScript, and C is available in the programming guide for decimal to hex conversion.
What Is Two's Complement and How Does It Represent Negative Hex Values?
Two's complement was introduced earlier as the method computers use to represent negative numbers in hex and binary without a minus sign. It works by flipping every bit in the positive binary version of a number and then adding one, all within a fixed bit width such as 8, 16, 32, or 64 bits.
Working through the full bit flipping process by hand, along with how different bit widths change the result, is covered step by step on the two's complement calculator.
How Is Hexadecimal Used in Computer Memory Addresses and IP Networking?
Memory addresses and error codes in most systems are displayed in hex rather than binary, since a hex value stays compact even when it represents a long string of binary digits, four bits at a time. Anyone reading a crash log, a debugger, or firmware output will run into hex addresses regularly.
Hex and binary conversion also sit behind the scenes in IP subnetting and network address calculations. If you work with network configuration, the IP subnet calculator applies the same base conversion principles to addressing and subnet masks.

