Decimal to Hex Calculator
Convert a decimal (base 10) number to hexadecimal (base 16).
- Free to use
- Accurate results
- No registration required
- Works on all devices
Enter a decimal number to convert it to hexadecimal.
A non-negative whole number.
Your result
ff
Hex
AI explanation
Formula
Repeated division by 16, reading the remainders (as hex digits) from bottom to topWorked example
255 to hex
| Field | Value |
|---|---|
| Decimal number | 255 |
| Hex | ff |
Assumptions
- Only non-negative whole numbers are supported.
- The result uses lowercase letters a-f for digit values 10-15.
Frequently asked questions
How do I convert decimal to hex by hand?
Repeatedly divide the decimal number by 16, recording the remainder each time (using a-f for remainders 10-15). Reading the remainders from the last division to the first gives the hex result.
Where might I see a hex value like this?
Hex is commonly used for color codes (like #ff0000 for red), memory addresses, and representing raw byte values in a compact form.
What about the reverse conversion?
Use the Hex to Decimal Calculator to convert a hex number back to decimal.