Decimal to Hex Converter — Instant Results, Both Directions
Type any decimal number and the hex equivalent appears instantly. No button. No delay. It works the other direction too — paste in a hex value and get the decimal result in real time. One tool, both conversions, zero friction.
Whether you're converting decimal to hex for an HTML color code, a memory address, a CS assignment, or just because you forgot the formula — you're in the right place. Type your value below.
Interactive Decimal & Hex Converter
Convert between decimal and hexadecimal instantly. Type in either field.
How to Convert Decimal to Hex
Converting decimal to hex uses one method every time — repeated division by 16. You don't need to memorise any formulas. You just divide, collect the remainders, and read them backwards. Three steps. Every single time.
1 Step 1 — Divide by 16 and Record the Remainder
Take your decimal number. Divide it by 16. Write down two things — the quotient (the whole number result) and the remainder (what's left over after the division). The remainder becomes a hex digit. The quotient becomes your new starting number for the next division. You keep dividing the quotient by 16 until it reaches zero.
2 Step 2 — Convert Remainders Above 9 to Letters
In decimal, the highest single digit is 9. In hexadecimal — a base-16 numeral system — you need 16 different symbols for a single digit position. The digits 0 through 9 work the same as decimal. But for values 10 through 15, hex uses letters.
| Decimal Remainder | Hex Digit |
|---|---|
| 0–9 | 0–9 |
| 10 | A |
| 11 | B |
| 12 | C |
| 13 | D |
| 14 | E |
| 15 | F |
3 Step 3 — Read Remainders Bottom to Top
The most common mistake: writing remainders top-to-bottom. They go BOTTOM to TOP. Always. After you've finished all your divisions, you have a column of remainders. The hex result is those remainders read bottom to top — not top to bottom.
Reading Direction
Worked Conversion Examples
Example: 255 to Hex
Example: 2024 to Hex
How to Convert Negative Decimal to Hex
Everything covered so far applies to positive integers. But what happens when the decimal number is negative? Negative numbers in hex use a method called two's complement. It's the standard way computers store negative integers in binary and hex.
Two's Complement Method
- 1
Step 1 — Ignore the negative sign. Convert the absolute value to binary first.
- 2
Step 2 — Flip every bit (one's complement).
- 3
Step 3 — Add 1 to the result.
- 4
Step 4 — Convert the final binary to hex.
Example: -5 to Hex
5 = 00000101 → Flip: 11111010 → Add 1: 11111011 → Hex: FB
Decimal to Hex Reference Table (0–255)
Every decimal value from 0 to 255 with its hexadecimal equivalent. This is the complete decimal to hex table for all single-byte values.
Showing first 256 values (0x00 to 0xFF). Each row follows base-16 alignment.
5 Common Mistakes in Decimal to Hex Conversion
Reading Top to Bottom
Remainders go BOTTOM to TOP. Reading down gives the reverse (wrong) value.
Writing Numbers Instead of Letters
10-15 must be A-F. Writing '14' instead of 'E' creates extra digits.
Thinking Hex 10 is Ten
Hex 10 is sixteen. In base-16, '10' means one unit of the base.
Confusing 0x Prefix
0x is just notation. Strip it before converting; add it when writing code.
Ignoring Case
FF and ff are identical. Hex is case-insensitive.
Frequently Asked Questions
How to convert decimal to hex?
Divide the decimal number by 16. Record the remainder. Use the quotient for the next division. Repeat until the quotient is 0. Read remainders from bottom to top.
What is 255 in hex?
255 in decimal is FF in hexadecimal.
Why use hex instead of decimal?
Hex is much easier to map to binary. One hex digit represents exactly 4 bits (a nibble), making two hex digits equal to one byte (8 bits).