Convert a decimal number to hexadecimal by repeated division by 16 – remainders above 9 become the letters A-F. The steps list every division for your input.
Show calculation steps
Processed privately in your browser — nothing you paste is uploaded, logged or stored.
Division by sixteen
Encoding decimal in hex uses the universal change-of-base algorithm: divide by 16 repeatedly and collect remainders, reading them bottom-up. Remainders of ten through fifteen are written A through F — the six letters that make base 16 possible with familiar symbols.
The steps panel executes the division chain on your exact number, which is both the proof of the result and the tutorial for the method.
Worked example
Input: 48879 48879 ÷ 16 = 3054 r 15 → F 3054 ÷ 16 = 190 r 14 → E 190 ÷ 16 = 11 r 14 → E 11 ÷ 16 = 0 r 11 → B Read upward: BEEF
| Power | Value |
|---|---|
| 16^0 | 1 |
| 16^1 | 16 |
| 16^2 | 256 |
| 16^3 | 4096 |
| 16^4 | 65536 |
| 16^5 | 1048576 |
Sanity checks worth knowing
The last hex digit equals your number mod 16 — an even decimal must end in an even hex digit, and multiples of 16 end in 0. Length-wise, each hex digit spans a factor of 16, so five digits reach about a million. These two instincts catch most transcription slips unaided.
Why the conversion is everywhere
Colors (#RRGGBB is three bytes), memory addresses and offsets, Unicode code points (U+1F600), error codes, and MAC/UUID segments — all are decimal quantities the machine world writes in hex. Moving fluently between the notations is table stakes for systems work.
Exactness and privacy
BigInt division keeps arbitrarily long decimals exact — the 2⁵³ cliff where float-based tools silently fail does not exist here. Negative inputs carry a minus sign through; two’s-complement patterns are the Signed tools’ domain. Local processing, always.
How to use the Decimal to Hex Converter
- Enter the decimal number.
- Click "Convert to hex".
- The steps show each division by 16 with its remainder – remainders 10-15 written as A-F.
- Options: lowercase, 0x prefix, digit grouping.
Frequently asked questions
How does repeated division by 16 give hex digits?
Each division splits the number into "16s" and a leftover 0-15 – and that leftover IS the next hex digit, lowest place first. 48879 ÷ 16 = 3054 r 15(F), then 3054 ÷ 16 = 190 r 14(E)… producing BEEF read bottom-up.
When do letters appear in the answer?
Whenever a remainder lands between 10 and 15: A=10 through F=15. They are ordinary digits with two-character-glyph names – nothing special is happening mathematically.
Why convert decimal IDs and colors to hex at all?
Compactness against binary structure: colors are three bytes shown as six hex digits, memory addresses align to hex boundaries, and error codes like 0xC0000005 encode flag fields readable per-nibble.
What is the biggest decimal this converts?
No fixed bound – BigInt keeps a 50-digit decimal exact through every division. Above 2^53, ordinary JavaScript arithmetic corrupts values; this tool is specifically immune.
How do I sanity-check a result?
Reverse one place: the last hex digit is the remainder of your number mod 16 – so an even decimal must end in an even hex digit, and anything divisible by 16 ends in 0. For a full check, the Hex to Decimal converter recomputes place values.
Does a negative decimal work?
Yes – you get a minus sign with the hex magnitude (-2A for -42). If you actually need the two's-complement pattern a CPU stores, that is the Decimal to Signed Binary tool followed by grouping, or the complement calculators.
Is this computed on your servers?
No – the divisions run in your browser. The value never leaves the page.