Skip to content
ConvertCalculate

Decimal to Hexadecimal

Instantly convert decimal numbers to hexadecimal format for simplified representation of large numbers in computing, memory allocation, or programming tasks, saving time and effort.

  • Free
  • Instant results
  • Runs in your browser
In short

To convert decimal to hexadecimal, divide the number by 16 repeatedly and read the remainders from bottom to top. For example, decimal 45 is 2D in hexadecimal.

How it works

Decimal counts in base 10, hexadecimal counts in base 16. Converting means rewriting the same quantity with a different set of digits — the value never changes, only how it is written.

  1. Divide the decimal number by 16.
  2. Write down the remainder — that is the last digit of the hexadecimal number (10–15 are written A–F).
  3. Repeat with the quotient until it reaches zero, then read the remainders bottom to top.

The reverse conversion is Hexadecimal to Decimal, which also handles every other base pair.

Examples

Worked examples, digit by digit:

  • 255 (decimal) = 255 in decimal = FF (hexadecimal)
  • 511 (decimal) = 511 in decimal = 1FF (hexadecimal)
Common values in every base
DecimalBinaryOctalHexadecimal
0000
1111
21022
410044
81000108
10101012A
15111117F
16100002010
321000004020
64100000010040
100110010014464
25511111111377FF

Decimal to Hexadecimal: frequently asked questions

How do I convert decimal to hexadecimal?
Divide the number by 16 repeatedly and read the remainders from bottom to top. For example, decimal 45 is 2D in hexadecimal. The converter above does this instantly for any value.
What is 255 in hexadecimal?
Decimal 255 equals FF in hexadecimal (the value 255, the largest number that fits in one byte).
Why are decimal and hexadecimal used?
Decimal (base 10) is the everyday number system. Hexadecimal (base 16) writes each byte as two characters.