Decimal to Hex Converter

Enter a decimal number to get its hexadecimal form, with each division by sixteen shown.

Hex
BEEF
Base 21011 1110 1110 1111
Base 8137357
Base 1048,879
Base 16BEEF

Working

DivideQuotientRemainder
48879 ÷ 163054F
3054 ÷ 16190E
190 ÷ 1611E
11 ÷ 160B

Read the remainders from bottom to top: BEEF

The method

Divide by 16 and keep the remainder, writing 10–15 as A–F. Repeat with the quotient until it is 0, then read the remainders upwards.

Place value: the idea behind every base

In any base, a digit’s worth depends on its column. Each column is worth the base times the column to its right. Tap a digit to change it and watch the total.

1651,048,5761,048,576
16465,5360
1634,0964,096
162256256
161160
16011

1×1,048,576 + 1×4,096 + 1×256 + 1×1 = 1,052,929 in decimal

Decimal is the same system with ten digits: 347 is 3×100 + 4×10 + 7×1. Nothing about base 10 is special apart from our ten fingers.

Decimal to hex table

DecimalHex
10A
15F
1610
3220
6440
10064
1277F
12880
200C8
255FF
256100
10003E8
40961000
65535FFFF
1000000F4240
16777215FFFFFF

Need another base, such as base 3 or base 36? Use the number system converter.

Questions people ask

How do I convert decimal to hex?

Divide by 16, record the remainder as a hex digit (10 = A … 15 = F), and repeat with the quotient. 254 → 15 r14 (E) → 0 r15 (F), so 254 = FE.

What is 255 in hex?

FF. And 256 is 100, the same way 99 + 1 rolls over to 100 in decimal.

How do I turn an RGB colour into hex?

Convert each channel (0–255) to two hex digits and join them: rgb(255, 136, 0) → FF, 88, 00 → #FF8800.

Related tools