Decimal to Hexadecimal Converter
Type a decimal number to see it as hexadecimal, plus the other bases.
Free · Runs in your browser · Your text is never uploaded
How to convert decimal to hexadecimal
Divide the number by 16 repeatedly and write down the remainders, using A–F for 10–15. Read the remainders from last to first to get the hex number.
Worked example
The decimal number 255 is FF in hexadecimal.
Convert many at once
Put one number per line to convert a whole list, and copy the results.
A worked example
Convert 48879 to hexadecimal by dividing repeatedly by 16: 48879 ÷ 16 = 3054 remainder F; 3054 ÷ 16 = 190 remainder E; 190 ÷ 16 = 11 remainder E; 11 ÷ 16 = 0 remainder B. Reading the remainders from bottom to top gives BEEF.
Where it is used
Writing color values, setting a register or flag, or turning a decimal ID into the hex form a tool expects.
Tips
Spaces and underscores inside a number are ignored, so you can paste values like 1010 1111. Add a prefix (0x, 0b or 0o) if you are unsure which base a number is in. For the theory behind all four bases, read binary, decimal and hexadecimal explained.
Need more options? Open the full Number Base Converter.
Related guides
Frequently asked questions
How do I convert decimal to hexadecimal?
Enter the decimal number above and the hexadecimal result appears instantly.
Does it work for large numbers?
Yes, the arithmetic is exact for numbers up to 4,000 digits.
Can I convert negative numbers?
Yes, the minus sign is kept. Two’s complement is not applied.