Decimal to hex

Type a decimal number and see its hexadecimal value instantly, along with the binary and octal. Everything happens in your browser.

255₁₀ = FF₁₆

🔒 What you type never leaves your device. Everything is calculated in your browser.

Type in any of the four fields and the others update on their own. No size limit, and only for positive whole numbers.

Any base (2 to 36)

Text to binary and hex

You can paste bits to turn them into text.

How to convert decimal to hex

  1. Type the number in the "Decimal (base 10)" field.
  2. See the result in "Hexadecimal (base 16)", highlighted.
  3. You also get the binary and octal of the same number.
  4. Tap Copy to take the results with you.

The method and an example

Divide the number by 16 again and again and write down the remainders (10 to 15 are written A to F), read from bottom to top. For example, 255 ÷ 16 = 15 remainder 15; 15 ÷ 16 = 0 remainder 15. The remainders 15 and 15 are F and F: FF.

Another example: 26 ÷ 16 = 1 remainder 10, so 26 is 1A. The table below shows the first numbers in all four bases.

Decimal (base 10)Binary (base 2)Octal (base 8)Hexadecimal (base 16)
0000
1111
21022
31133
410044
510155
611066
711177
81000108
91001119
10101012A
11101113B
12110014C
13110115D
14111016E
15111117F
16100002010
17100012111
18100102212
19100112313
20101002414
21101012515
22101102616
23101112717
24110003018
25110013119
2611010321A
2711011331B
2811100341C
2911101351D
3011110361E
3111111371F
321000004020
401010005028
501100106232
64100000010040
100110010014464
12711111111777F
1281000000020080
20011001000310C8
25511111111377FF
256100000000400100
5001111101007641F4
51210000000001000200
1000111110100017503E8
1024100000000002000400
40961000000000000100001000
655351111111111111111177777FFFF

Good to know

Frequently asked questions

How do I convert 255 to hexadecimal?

Divide by 16: the result is FF.

What is 16 in hexadecimal?

10, read "one zero", meaning one 16 plus zero units.

Does it work for web colors?

Yes: convert each component from 0 to 255 and join them as #RRGGBB.

Is my data sent to a server?

No. The conversion happens in your browser.