Decimal to Hex Converter
Convert decimal numbers to hexadecimal, from small values to numbers with thousands of digits, in upper- or lowercase.
Runs in your browser. What you enter is kept for 30 days to improve Toolgrid, then deleted.
How to use the Decimal to Hex Converter
- 1 Type a whole number in decimal.
- 2 Choose upper- or lowercase letters.
- 3 Copy the hexadecimal result.
About the Decimal to Hex Converter
To write a number in hexadecimal, divide it by 16 again and again; the remainders, from last to first, are the hex digits, with 10 to 15 written as A to F. 255 becomes FF and 4096 becomes 1000.
The converter uses exact big-number arithmetic, so large values such as 2^128 − 1 come out exactly (FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF). Spaces and underscores in the input are ignored.
Negative numbers get a minus sign (−26 becomes −1A); two’s complement representations depend on a fixed width and aren’t used. Hex to Decimal converts back.
Frequently asked questions
What is 255 in hex?
FF.
Why are there letters in hexadecimal?
Base 16 needs 16 digits. After 0–9, the letters A–F stand for 10–15.
Uppercase or lowercase?
Both are correct and mean the same. Uppercase is common in documentation, lowercase in code and hashes.
How do I write it in code?
Most languages use the 0x prefix: 0xFF. In CSS colours, a # is used instead.