Developer
Encoders, converters & dev utilities
Decimal to Hex Converter — with Step-by-Step Working
Convert a decimal number like 255 to hexadecimal and see the working. The method is repeated division by 16: divide, record each remainder as a hex digit (10–15 become A–F), then read the remainders bottom-to-top. Worked example: 255 ÷ 16 = 15 r15, 15 ÷ 16 = 0 r15; both remainders are 15 = F, so 255₁₀ = FF₁₆. A smaller value like 10 is a single digit: 10 = A₁₆. Hex is the compact way to write bytes — two hex digits per byte — which is why colors and addresses use it. This tool shows all four bases at once, uses BigInt for large inputs, and runs 100% in your browser. Free, no login.
Decimal → hex = repeatedly divide by 16, write each remainder as a hex digit (10–15 → A–F), read bottom-to-top
- Byte-exact worked example: 255 → 255÷16=15 r15(F), 15÷16=0 r15(F) → FF₁₆
- Single digit: 10₁₀ = A₁₆ (and 1010₂ = 12₈)
- Cross-check: FF₁₆ = 15·16 + 15 = 255₁₀ ✓ (two hex digits = one byte)
- Large inputs use BigInt (no float error); runs 100% client-side
Frequently asked questions
How do I convert decimal to hex?
Divide the number by 16 repeatedly, recording each remainder as a hex digit (values 10–15 become A–F), until you reach 0, then read the remainders from last to first. For 255: 255÷16 = 15 remainder 15 (F), 15÷16 = 0 remainder 15 (F), giving FF. The tool shows the ladder and also the binary and octal forms.
What is 255 in hexadecimal?
255 in hex is FF. Both hex digits are F (15): 15·16 + 15 = 255. It is the largest value in a single byte, so FF is the maximum for a color channel (#FF) or an 8-bit register (0xFF), and in binary it is 11111111.
How do I check my decimal-to-hex answer?
Convert the hex back to decimal by place value: multiply each digit (A–F = 10–15) by its power of 16 and add. For FF that is 15·16 + 15 = 255, matching the input, so it is correct. The round-trip is the fastest sanity check, especially when letters A–F are involved.