Decimal to Hex Converter
Convert decimal to hexadecimal fast. Enter your value, see the result instantly, and copy the output for programming, study, and quick checks.
Enter your Decimal Digits
What the decimal to hex converter does
This takes an ordinary decimal number and writes it in hexadecimal, the base-16 shorthand used across programming. Type your number in, press the button, and copy out the hex.
It is the tool you want when you have a plain number, a colour value, a size, an address, and you need it in the compact hex form that code and design tools expect.
How to use it
- Enter your decimal number. Type the everyday whole number you want in hex, for example 700.
- Press Convert. The hex version appears in the output box, using digits 0 to 9 and letters A to F.
- Click the result to copy it. Tap the output to send it to your clipboard.
Press Reset to clear both boxes.
How it works: divide by sixteen
Writing a number in hex uses the same divide-and-collect-remainders idea as binary, except you divide by 16 instead of by 2, because hex is base 16. You divide your number by 16 and note the remainder, which is somewhere from 0 to 15. Then you divide the quotient by 16 and note that remainder, and you keep going until the quotient reaches 0. Reading the remainders from the bottom up gives you the hex number.
The only twist is that a remainder can be as large as 15, which is too big to write as a single ordinary digit. That is exactly where the letters come in: any remainder from 10 to 15 is written as a letter, A through F.
A worked example with real numbers
Let us convert 700.
- 700 ÷ 16 = 43, remainder 12, and 12 is written as C
- 43 ÷ 16 = 2, remainder 11, and 11 is written as B
- 2 ÷ 16 = 0, remainder 2
Read the remainders from the bottom up: 2, B, C. So 700 in decimal is 2BC in hex. To check it, read it back by place value: 2 × 256 + 11 × 16 + 12 = 512 + 176 + 12 = 700. A simpler one to keep in your head is 255, which comes out as FF.
The remainder-to-letter map
The whole letter business is just these six values. Any remainder of 10 or more becomes a letter.
| Remainder | Hex digit |
|---|---|
| 10 | A |
| 11 | B |
| 12 | C |
| 13 | D |
| 14 | E |
| 15 | F |
Anything 0 to 9 stays as the ordinary digit. The tool gives the letters as capitals, which is the usual convention.
Why write a number in hex at all
The payoff is compactness, and it comes from a clean fit with binary. Sixteen is two to the fourth, so one hex digit stands for exactly four binary bits. That means a whole byte, eight bits, fits neatly into two hex digits, running from 00 up to FF, which is 0 to 255. So a value that would be a long, error-prone run of 0s and 1s shrinks to a short hex string you can read at a glance. That is why colours, byte values, and memory addresses are nearly always written in hex rather than binary. One small thing to note: this converter works with whole numbers, which is the normal case for the values hex is used for.
Questions people ask
How do I convert decimal to hex by hand?
Divide the number by 16 and note the remainder, then divide the quotient by 16 and note that remainder, and keep going until the quotient is 0. Read the remainders bottom to top, writing any remainder of 10 to 15 as A to F.
What is 255 in hex?
FF. It is the largest value two hex digits can hold, which is exactly one byte, so a byte runs from 00 to FF.
Why do some hex numbers contain letters?
Because a single hex digit has to represent values up to 15, and the values 10 through 15 are written as A through F so each one stays a single character.
Are the letters uppercase or lowercase?
This tool returns them as capitals, A to F, which is the common convention. Lowercase a to f means the same values where a tool accepts it.
References
- Weisstein, Eric W. "Hexadecimal." From MathWorld, A Wolfram Resource. https://mathworld.wolfram.com/Hexadecimal.html
Ankit Khatiwada is a researcher and graduate student in Computer Science at Saarland University, with strengths in statistics, data analysis, data engineering, and full stack development. His work sits at the intersection of quantitative reasoning and applied technology, making him a strong fit for tools that depend on clear numerical logic. At Eon Tools, he reviews number and statistical tools.