devkult_
tools24converters26
home/convert/decimal-to-hex

Convert Decimal to Hexadecimal

Hexadecimal is the compact notation behind color codes, memory addresses, and byte values. This converter turns base-10 integers into their base-16 representation, one number per line.

Example · DecimalHex
Decimal input
10
255
4096
65535
Hex output
a
ff
1000
ffff

How to convert Decimal to Hex

  1. Take your base-10 integer.
  2. Repeatedly divide by 16, recording remainders as hex digits (10–15 become a–f).
  3. Read the remainders bottom-up — 255 becomes ff.

Frequently asked questions

What is 255 in hexadecimal?

255 is ff, the largest value a single byte can hold. That is why color channels run from 00 to ff.

Should I add a 0x prefix?

The converter returns the bare digits. Add 0x (e.g. 0xff) when the context is code, or # for a CSS color.

Related converters