Decimal to Hex Converter
Repeated division by 16
Enter a decimal number to get its hexadecimal form and the remainders (0–15, written 0–F) that produce it.
Divide by 16, keep the remainders
Decimal to hexadecimal uses the same method as decimal to binary, with 16 as the divisor. Remainders 10 to 15 are written A to F.
| Step | Division | Remainder |
|---|---|---|
| 1 | 2026 ÷ 16 = 126 | 10 → A |
| 2 | 126 ÷ 16 = 7 | 14 → E |
| 3 | 7 ÷ 16 = 0 | 7 |
Reading the remainders from the bottom up gives 7EA. Two hex digits make one byte, which is why the output is grouped in pairs: 65535 is FF FF, two bytes of all ones.
When the result has an odd number of hex digits, the converter pads the first byte with a zero. For 2026, it displays 07 EA. The leading zero preserves the value and makes the two byte boundaries visible.
Where you will use it
- Colors: rgb(255, 136, 0) is #FF8800, one byte per channel.
- Memory and file offsets: debuggers and hex editors show addresses in hex.
- Character codes: “A” is 65 in decimal and 41 in hex; see the ASCII table.
Related guides
More
Other Number System Conversions
Related numeral systems converters for number conversion between binary, decimal, hexadecimal, octal, and ASCII text.
Binary to Decimal Converter Binary Fraction to Decimal Signed Binary to Decimal Binary to Hexadecimal Binary to Octal Binary Base Converter Binary Calculator Binary Addition Binary Subtraction Step-by-Step Solver Binary Table Generator Binary to Text Text to Binary Floating Point Converter Bit Size Converter Bitwise Operations Binary Decoder Hex to Decimal Decimal to Binary Hex to Binary Hex Calculator ASCII Table Subnet Calculator YAML to JSON JSON to YAML JSON to CSV
FAQ
Frequently Asked Questions
How do you convert decimal to hex?
Divide by 16 and keep the remainder; remainders 10–15 are written A–F. Repeat with the quotient until it is 0, then read the remainders bottom to top. 2026 → 2026 ÷ 16 = 126 r 10 (A), 126 ÷ 16 = 7 r 14 (E), 7 ÷ 16 = 0 r 7 → 7EA.
What is 255 in hex?
FF. 255 = 15 × 16 + 15.
Why is hex used for colors?
Each RGB channel is one byte (0–255), and one byte is exactly two hex digits, so #FF8800 reads as red FF, green 88, blue 00.