Math
Decimal to Hex Converter
Enter a decimal number and the converter divides it by 16 repeatedly, maps each remainder to a hex digit (10-15 become A-F), and reads the digits bottom to top.
Fractions are handled by repeated multiplication, and negatives can be encoded in two's complement.
Any whole or decimal number. Commas are ignored; a minus sign is allowed.
Two's complement is how computers store negative whole numbers.
Try an example
Result
Converted value
—
- Decimal
- —
- Binary
- —
- Hexadecimal
- —
- Octal
- —
Student quick launch
Grade planning, algebra checks, and formulas students reach for most.
Study path
Use this calculator with
Follow these when you want the formula behind the answer, a short lesson, or nearby tools in the same topic.
What the decimal to hex converter solves
Hexadecimal is the compact way programmers write binary: one hex digit per four bits. Converting decimal to hex uses the same repeated-division idea as decimal to binary, but dividing by 16 and translating remainders 10-15 into the letters A-F. This converter shows each division and the digit it produces.
Remainder to hex digit
| Remainder | 10 | 11 | 12 | 13 | 14 | 15 |
|---|---|---|---|---|---|---|
| Hex digit | A | B | C | D | E | F |
How to use it
- Type the decimal number (commas allowed).
- Add a decimal point for a fractional value; the fraction is converted by multiplying by 16.
- For negatives, pick a minus sign or two's complement with a bit width (8, 16, 32, or 64).
- Read the division table bottom to top to build the hex string, then check the nibble table against the binary.
How to read the answer
The hex result is shown in uppercase. Each hex digit corresponds to a 4-bit group in the binary equivalent, which the nibble table lays out. In two's complement mode the hex string is the exact byte pattern a computer would store, for example −1 at 8 bits is FF.
Common mistakes and edge cases
- Writing a remainder of 12 as "12" instead of C. Every remainder is one hex digit.
- Reading the remainders top to bottom. The first remainder is the rightmost digit.
- Decimal fractions often repeat in hex: 0.1 = 0.1999… (hex). The repeating block is marked in parentheses.
- Two's complement hex needs a width. −1 is FF at 8 bits but FFFF at 16 bits.
- Values above the width's signed range are reported as out of range instead of silently wrapping.
Worked examples
Typical number
6719
Converted value
1A3F
Byte maximum
255
Converted value
FF
Fraction
15.5
Converted value
F.8
Negative with sign
−255
Converted value
-FF
Negative in two's complement
−1 at 16 bits
Converted value
FFFF
Zero
0
Converted value
0
Large number
4,294,967,295
Converted value
FFFFFFFF
Frequently asked questions
How do you convert decimal to hex?+
Divide by 16 and note the remainder; convert remainders 10-15 to A-F. Divide the quotient by 16 again until it reaches 0, then read the remainders from last to first. 255 ÷ 16 = 15 R 15 → F, 15 ÷ 16 = 0 R 15 → F, so 255 = FF.
What is 255 in hex?+
FF. It is the largest value in one byte (8 bits), which is why color channels run from 00 to FF.
How do I write a negative number in hex?+
On paper, use a minus sign (−FF). In a computer, use two's complement at a fixed width: −1 is FF at 8 bits, FFFF at 16 bits, and FFFFFFFF at 32 bits.
Can I convert a decimal fraction to hex?+
Yes. Multiply the fraction by 16; the whole part is the next hex digit. 0.5 × 16 = 8, so 0.5 = 0.8 in hex. Many decimal fractions repeat in hex, just as in binary.
Why do programmers prefer hex to binary?+
A hex digit is exactly four bits, so hex is a lossless shorthand: 11111111 is FF and a 32-bit address is only eight hex digits.
About this calculator
- Written by
- mathcheck editorial team
- Last reviewed
- September 4, 2026
Method
- Uses the values entered by the user and stable formulas documented on the page.
Related calculators
Hex to Decimal Converter
Convert hexadecimal to decimal with the place-value table (digit × 16^n), the digit-to-value key for A-F, nibble grouping into binary, and signed two's complement reading.
Decimal to Binary Converter
Convert decimal to binary with the repeated-division steps, fractional parts by repeated multiplication (0.625 → 0.101), repeating-fraction detection, and negatives as a sign or two's complement.
Hex to Binary Converter
Convert hex to binary one nibble at a time: each hex digit becomes exactly four bits. Shows the nibble table, the decimal value, and octal, with fractional hex supported.
Two's Complement Calculator
Convert decimal to two's complement and back at 4, 8, 16, 32, or 64 bits with the invert-and-add-1 steps, the sign bit highlighted, overflow detection, and the unsigned reading of the same bits.
Base Converter
Convert any number between any two bases from 2 to 36 with the steps shown: place-value expansion to decimal, repeated division into the target base, and fraction handling with repeat detection.
Binary to Decimal Converter
Convert binary to decimal with the positional-weight table (bit × 2^n), fractional bits after the binary point, and an option to read the bits as a signed two's complement number.
Last updated: September 4, 2026