Decimal to Hex Converter
Hexadecimal is a compact way to write numbers, especially byte and color values, because each digit covers four bits. To convert a decimal number you divide repeatedly by 16, mapping any remainder of 10–15 to the letters A–F.
Type a decimal number below to get its hexadecimal form instantly. The output uses uppercase A–F for clarity, and the whole conversion runs locally in your browser with nothing uploaded.
| Decimal | Hex | Note |
|---|---|---|
10 | A | first letter digit |
15 | F | largest single digit |
16 | 10 | rolls over to two digits |
255 | FF | max 8-bit value |
4096 | 1000 | 16³ |
255→FF255 ÷ 16 = 15 remainder 15, so both digits are F.
Frequently asked questions
How do I convert decimal to hex manually?
Divide the number by 16 repeatedly and record each remainder, mapping 10–15 to A–F. Reading the remainders from last to first gives the hex value. 255 → 15,15 → FF.
Why use hex instead of decimal?
Hex aligns cleanly with bytes — two hex digits equal one byte — so it is the natural notation for memory addresses, color codes, and binary data dumps.
Does the output include a 0x prefix?
This tool outputs the bare hex digits. You can prepend 0x yourself when writing source code that expects it, such as in C or JavaScript.
Is the conversion private?
Yes. It runs entirely in your browser; your number is never transmitted.