Converters
Convert decimal numbers to hex
Decimal to hex converter prints a whole number in base 16, with uppercase letters. Developers use it for color values (255 is FF, the red channel of #FF0000) and for translating offsets, code points or byte constants into the hex their tools expect. Output is compact: no 0x prefix and no leading zeros, so 15 prints as F, and negatives keep their sign. Conversion is exact at any size, and one number per line converts a column at once.
How to use Decimal to Hex
- Open Decimal to Hex in the Toolbox101 app.
- Type a whole decimal number such as
255into theDecimal numberbox, or several, one per line. - Read the uppercase hex result in the
Outputbox, with no0xprefix and no leading zeros. - Click
Copyand paste the value where your code, style sheet or notes expect hex.
Worked example
Decimal to Hex returns the output below for this input.
Input
255Output
FFCheck it yourself: open Decimal to Hex and enter the same input.
Frequently asked questions
Why does the tool print uppercase hex letters?
The conversion applies an uppercase transform so letters print as A through F rather than a through f. The two forms carry the same value and every decoder treats them identically, but uppercase matches the style most color pickers and hardware datasheets use.
Does the output include a 0x prefix?
No. The Output box holds plain hex digits such as FF, with no 0x marker and no leading zeros. If the destination needs the prefix (as in JavaScript or C source), add 0x yourself when you paste the value into code.
What is 255 in hex, and why does it matter?
255 prints as FF. Because one byte holds 0 to 255, FF is shorthand for a full byte, which is why every CSS color channel maxes out at FF: white is #FFFFFF and pure red is #FF0000. This tool converts those channel values directly.
How do I convert decimal to hex by hand?
Divide by 16 repeatedly and map remainders of 10 through 15 to A through F. For 255: 255/16 is 15 remainder 15, and 15 is F, giving FF. To check, paste FF into the Hex to Decimal tool here and confirm it prints 255 back.
Use Decimal to Hex now
Runs in your browser. Nothing you type is uploaded.