How to use Decimal to Hex
- Type your decimal number, for example 255. A leading minus sign is allowed.
- Read the hexadecimal value in the result box.
- Tick "Group digits" to split long results into blocks of four.
- Click Copy to copy the hex value.
Features
- Exact for large whole numbers, beyond 64 bits
- Hex output in capital letters
- Optional grouping of digits in blocks of four
- Also shows the value in binary and octal
- Runs in your browser, so nothing is uploaded
Supported formats and limits
- Maximum input: 10,000,000 characters
Examples
| Input | Result |
|---|---|
| 255 | FF |
| 4096 | 1000 |
| 3735928559 | DEADBEEF |
| -255 | -FF — The minus sign is kept. |
Limitations
- Only whole numbers are supported; decimals such as 0.5 are not converted.
- Negative numbers get a minus sign, not a two’s complement representation.
- The 0x prefix is not added to the output; add it yourself if your code needs it.
Learn more
Converting decimal to hexadecimal means rewriting a number in base 16, where the digits are 0–9 and A–F. The hand method is repeated division by 16: each division leaves a remainder between 0 and 15, and the remainders read from last to first are the hex digits. For 255, dividing by 16 gives 15 remainder 15, and 15 is F, so the result is FF.
Hex is popular in computing because a byte always fits in exactly two hex digits (00 to FF), which makes long binary values compact and easy to compare. You meet it in color codes, memory addresses, character codes, hashes and network identifiers.
Many programming languages write hex literals with a 0x prefix, for example 0xFF. The prefix is notation for the compiler, not part of the number, so this converter leaves it out. Exact integer arithmetic is used, so a value like 3735928559 converts to DEADBEEF without any rounding.
Frequently asked questions
How do I convert decimal to hex by hand?
Divide the number by 16 repeatedly and note each remainder, writing 10 to 15 as A to F. Read the remainders from last to first. For 255: remainders 15 and 15, so FF.
Is the output upper or lower case?
Capital letters. Hex is case-insensitive, so you can lowercase it if your code prefers that.
How do I get a color code from decimal values?
Convert each red, green and blue value (0–255) separately and join them as two digits each. For a full picker use the RGB to HEX converter.
Is my input uploaded?
No. The conversion runs in your browser.
Sources
Last reviewed: September 30, 2026