Skip to content

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.

0x

✓ Copied!
📋 Step-by-Step

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

Read Last BOTTOM TO TOP Read First

Worked Conversion Examples

Example: 255 to Hex

255 ÷ 16 = 15 R 15 (F)
15 ÷ 16 = 0 R 15 (F)
Res: FF

Example: 2024 to Hex

2024 ÷ 16 = 126 R 8
126 ÷ 16 = 7 R 14 (E)
7 ÷ 16 = 0 R 7
Res: 7E8

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.

DEC 0 00
DEC 1 01
DEC 2 02
DEC 3 03
DEC 4 04
DEC 5 05
DEC 6 06
DEC 7 07
DEC 8 08
DEC 9 09
DEC 10 0A
DEC 11 0B
DEC 12 0C
DEC 13 0D
DEC 14 0E
DEC 15 0F
DEC 16 10
DEC 17 11
DEC 18 12
DEC 19 13
DEC 20 14
DEC 21 15
DEC 22 16
DEC 23 17
DEC 24 18
DEC 25 19
DEC 26 1A
DEC 27 1B
DEC 28 1C
DEC 29 1D
DEC 30 1E
DEC 31 1F
DEC 32 20
DEC 33 21
DEC 34 22
DEC 35 23
DEC 36 24
DEC 37 25
DEC 38 26
DEC 39 27
DEC 40 28
DEC 41 29
DEC 42 2A
DEC 43 2B
DEC 44 2C
DEC 45 2D
DEC 46 2E
DEC 47 2F
DEC 48 30
DEC 49 31
DEC 50 32
DEC 51 33
DEC 52 34
DEC 53 35
DEC 54 36
DEC 55 37
DEC 56 38
DEC 57 39
DEC 58 3A
DEC 59 3B
DEC 60 3C
DEC 61 3D
DEC 62 3E
DEC 63 3F
DEC 64 40
DEC 65 41
DEC 66 42
DEC 67 43
DEC 68 44
DEC 69 45
DEC 70 46
DEC 71 47
DEC 72 48
DEC 73 49
DEC 74 4A
DEC 75 4B
DEC 76 4C
DEC 77 4D
DEC 78 4E
DEC 79 4F
DEC 80 50
DEC 81 51
DEC 82 52
DEC 83 53
DEC 84 54
DEC 85 55
DEC 86 56
DEC 87 57
DEC 88 58
DEC 89 59
DEC 90 5A
DEC 91 5B
DEC 92 5C
DEC 93 5D
DEC 94 5E
DEC 95 5F
DEC 96 60
DEC 97 61
DEC 98 62
DEC 99 63
DEC 100 64
DEC 101 65
DEC 102 66
DEC 103 67
DEC 104 68
DEC 105 69
DEC 106 6A
DEC 107 6B
DEC 108 6C
DEC 109 6D
DEC 110 6E
DEC 111 6F
DEC 112 70
DEC 113 71
DEC 114 72
DEC 115 73
DEC 116 74
DEC 117 75
DEC 118 76
DEC 119 77
DEC 120 78
DEC 121 79
DEC 122 7A
DEC 123 7B
DEC 124 7C
DEC 125 7D
DEC 126 7E
DEC 127 7F
DEC 128 80
DEC 129 81
DEC 130 82
DEC 131 83
DEC 132 84
DEC 133 85
DEC 134 86
DEC 135 87
DEC 136 88
DEC 137 89
DEC 138 8A
DEC 139 8B
DEC 140 8C
DEC 141 8D
DEC 142 8E
DEC 143 8F
DEC 144 90
DEC 145 91
DEC 146 92
DEC 147 93
DEC 148 94
DEC 149 95
DEC 150 96
DEC 151 97
DEC 152 98
DEC 153 99
DEC 154 9A
DEC 155 9B
DEC 156 9C
DEC 157 9D
DEC 158 9E
DEC 159 9F
DEC 160 A0
DEC 161 A1
DEC 162 A2
DEC 163 A3
DEC 164 A4
DEC 165 A5
DEC 166 A6
DEC 167 A7
DEC 168 A8
DEC 169 A9
DEC 170 AA
DEC 171 AB
DEC 172 AC
DEC 173 AD
DEC 174 AE
DEC 175 AF
DEC 176 B0
DEC 177 B1
DEC 178 B2
DEC 179 B3
DEC 180 B4
DEC 181 B5
DEC 182 B6
DEC 183 B7
DEC 184 B8
DEC 185 B9
DEC 186 BA
DEC 187 BB
DEC 188 BC
DEC 189 BD
DEC 190 BE
DEC 191 BF
DEC 192 C0
DEC 193 C1
DEC 194 C2
DEC 195 C3
DEC 196 C4
DEC 197 C5
DEC 198 C6
DEC 199 C7
DEC 200 C8
DEC 201 C9
DEC 202 CA
DEC 203 CB
DEC 204 CC
DEC 205 CD
DEC 206 CE
DEC 207 CF
DEC 208 D0
DEC 209 D1
DEC 210 D2
DEC 211 D3
DEC 212 D4
DEC 213 D5
DEC 214 D6
DEC 215 D7
DEC 216 D8
DEC 217 D9
DEC 218 DA
DEC 219 DB
DEC 220 DC
DEC 221 DD
DEC 222 DE
DEC 223 DF
DEC 224 E0
DEC 225 E1
DEC 226 E2
DEC 227 E3
DEC 228 E4
DEC 229 E5
DEC 230 E6
DEC 231 E7
DEC 232 E8
DEC 233 E9
DEC 234 EA
DEC 235 EB
DEC 236 EC
DEC 237 ED
DEC 238 EE
DEC 239 EF
DEC 240 F0
DEC 241 F1
DEC 242 F2
DEC 243 F3
DEC 244 F4
DEC 245 F5
DEC 246 F6
DEC 247 F7
DEC 248 F8
DEC 249 F9
DEC 250 FA
DEC 251 FB
DEC 252 FC
DEC 253 FD
DEC 254 FE
DEC 255 FF

Showing first 256 values (0x00 to 0xFF). Each row follows base-16 alignment.

5 Common Mistakes in Decimal to Hex Conversion

1

Reading Top to Bottom

Remainders go BOTTOM to TOP. Reading down gives the reverse (wrong) value.

2

Writing Numbers Instead of Letters

10-15 must be A-F. Writing '14' instead of 'E' creates extra digits.

3

Thinking Hex 10 is Ten

Hex 10 is sixteen. In base-16, '10' means one unit of the base.

4

Confusing 0x Prefix

0x is just notation. Strip it before converting; add it when writing code.

5

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).