Home › Unit Converters › Decimal to Hex Converter
Decimal to Hex Converter
Convert decimal to hex with our free decimal to hex converter — or flip it and turn hex numbers back into decimal. Hexadecimal shows up in web color codes, memory addresses, MAC addresses and program error codes, and all of those start from ordinary decimal numbers. This tool converts in seconds, with no sign-up, and also handles binary and octal.
How to use this converter
- Type the decimal number in the Number box, for example 255.
- Check that From is set to Decimal and To is set to Hexadecimal. Choose binary or octal if you need them.
- Read the answer in the result box. It updates as you type, and the line below shows both numbers with their bases.
- Use the Swap button to convert hex back to decimal without retyping.
Common values
| Decimal | Hexadecimal | Binary |
|---|---|---|
| 10 | A | 1010 |
| 16 | 10 | 10000 |
| 26 | 1A | 11010 |
| 100 | 64 | 1100100 |
| 255 | FF | 11111111 |
| 256 | 100 | 100000000 |
| 1,000 | 3E8 | 1111101000 |
| 4,096 | 1000 | 1000000000000 |
How it works
Hexadecimal is a base-16 system. Where decimal has ten digits (0–9) and rolls over at ten, hex has sixteen digits — 0–9 plus A, B, C, D, E and F for the values 10 to 15 — and rolls over at sixteen. Its place values are 1, 16, 256, 4,096 and so on, each 16 times the last.
To convert decimal to hex by hand, divide by 16 repeatedly and keep the remainders. For 255: 255 ÷ 16 = 15 remainder 15; then 15 ÷ 16 = 0 remainder 15. Read the remainders from last to first — 15, 15 — and write each as a hex digit: 15 is F. So 255 = FF. The method works for any size: 1,000 gives remainders 8, 14 and 3, read backwards as 3E8.
You can always check a hex answer by expanding it: each digit times its place value, added together. 3E8 = 3 × 256 + 14 × 16 + 8 × 1 = 768 + 224 + 8 = 1,000, so the conversion is right. The converter above performs both directions with exact whole-number arithmetic, so even very large numbers convert without rounding.
Decimal to hex conversion is a daily task in programming and web work. Color pickers turn your decimal RGB values (255, 87, 51) into #FF5733. Memory sizes, file offsets, Unicode code points and network addresses are all stored in decimal by humans and displayed in hex by machines — and now you can move between the two without the long division.
Worked example
A student needs the hex form of 255 for a computer-science assignment and wants to see the working, not just the answer.
Step 1: Divide 255 by 16 — 255 ÷ 16 = 15, remainder 15.
Step 2: Divide the result again — 15 ÷ 16 = 0, remainder 15.
Step 3: The remainders, read from last to first, are 15 and 15.
Step 4: Write 15 as a hex digit — F. So 255 = FF.
Check it back the other way: F × 16 + F × 1 = 240 + 15 = 255. Correct. Bigger numbers follow the same steps — 1,000 becomes 3E8 — and those are the exact results this converter gives.
FAQ
What is 255 in hex?
255 in decimal equals FF in hex. Divide 255 by 16: 255 ÷ 16 = 15 remainder 15, and 15 ÷ 16 = 0 remainder 15. Both remainders are 15, which is written as F, and reading them in reverse gives FF.
How do I convert decimal to hex by hand?
Divide the number by 16 again and again, writing down each remainder. When you reach zero, read the remainders from last to first, turning 10–15 into A–F. For 255: remainders 15 and 15, so FF.
What is 1000 in hex?
1000 in decimal equals 3E8 in hex. Check it back: 3 × 256 + 14 × 16 + 8 = 768 + 224 + 8 = 1,000. Numbers like this are why hex is handy for memory sizes and addresses.
Why do programmers write 0x before hex numbers?
The 0x prefix is a label that means “this number is hexadecimal”. Writing 0xFF instead of FF stops the reader (or the compiler) from mistaking it for a decimal number or a word.
What does FF mean in a color code?
In a web color like #FF5733, each pair of hex digits is one channel from 00 (0) to FF (255). FF5733 means red 255, green 87, blue 51 — a strong orange-red. FF is simply the largest two-digit hex number.
What is 16 in hex?
16 in decimal equals 10 in hex. That is the rollover point of base 16: just as decimal rolls from 9 to 10, hex rolls from F (15) to 10 (16). Similarly, 17 is 11 in hex and 26 is 1A.