Decimal to Hex Converter
Convert any decimal number to hexadecimal instantly. See the step-by-step division by 16, the binary and octal equivalents, and the digit count. Free, private, and runs entirely in your browser.
Enter a Decimal Number
Enter a decimal number and click Convert to Hexadecimal to see the result with a step-by-step breakdown.
Step-by-step breakdown
Summary
What does this Decimal to Hex Converter do?
This free online decimal to hex converter turns any base-10 number into its base-16 equivalent. Hexadecimal is a compact number system that uses 16 digits: 0 through 9 for the values 0–9, and the letters A through F for the values 10–15. It's widely used in computing because each hex digit maps exactly to 4 binary digits (bits), making it a convenient shorthand for binary data.
Beyond just showing you the hex result, this converter walks through the standard repeated-division method step by step. You'll see each division by 16, the remainder at each step (converted to its hex digit), and how the final hexadecimal number is assembled from the remainders read in reverse order. It also provides the binary and octal equivalents, since these number systems are closely related.
Everything runs locally in your browser. The number you enter never leaves your device — no server, no logs, no tracking. You can convert as many numbers as you want, with no limits and no signup.
How to convert decimal to hexadecimal
- Enter a decimal number: Type any non-negative integer (0, 1, 2, 3, …) up to 4,294,967,295 into the input field. You can also click one of the quick-pick buttons for common values.
- Click Convert: The converter instantly computes the hexadecimal equivalent and displays it.
- Review the breakdown: Below the result, you'll see each division by 16 with its quotient and remainder, showing exactly how the hexadecimal number was built.
- Check the alternatives: The binary and octal equivalents are shown alongside the bit count and number of hex digits.
- Copy if needed: Use the "Copy Results" button to grab a formatted summary.
That's it. No signup, no email, no waiting. The entire process takes seconds.
Decimal to hexadecimal conversion method
The standard method for converting a decimal integer to hexadecimal is repeated division by 16. Here's the complete algorithm.
Step 2: Record the remainder (0-15).
Step 3: If the remainder is 10-15, convert it to A-F.
Step 4: Divide the quotient by 16 again.
Step 5: Repeat until the quotient is 0.
Step 6: Read the remainders from bottom to top.
15 ÷ 16 = 0 remainder 15 → F ← most significant digit
Read bottom to top: FF
= 15×16 + 15×1
= 240 + 15
= 255
4 = 4 5 = 5 6 = 6 7 = 7
8 = 8 9 = 9 10 = A 11 = B
12 = C 13 = D 14 = E 15 = F
An alternative method is to convert the decimal to binary first, then group the binary digits into sets of 4 and convert each group to a single hex digit. This works because 16 = 2⁴, so four binary digits correspond exactly to one hexadecimal digit.
Decimal to hexadecimal reference table
Here's a quick reference for common decimal values and their hex equivalents, along with binary for comparison.
| Decimal | Hexadecimal | Binary | Common use |
|---|---|---|---|
| 0 | 0 | 0000 | Zero |
| 1 | 1 | 0001 | One bit set |
| 9 | 9 | 1001 | Single digit |
| 10 | A | 1010 | First hex letter |
| 15 | F | 1111 | 4 bits all set |
| 16 | 10 | 10000 | 2 hex digits |
| 128 | 80 | 10000000 | 1 byte (half) |
| 255 | FF | 11111111 | 1 byte max value |
| 256 | 100 | 100000000 | 2 bytes (16-bit) |
| 1000 | 3E8 | 1111101000 | Common value |
| 4096 | 1000 | 1000000000000 | Page size (4KB) |
| 65535 | FFFF | 1111111111111111 | 16-bit max value |
| 1048576 | 100000 | 100000000000000000000 | 1 MB in bytes |
| 16777215 | FFFFFF | 111111111111111111111111 | 24-bit max (RGB white) |
| 4294967295 | FFFFFFFF | 11111111111111111111111111111111 | 32-bit max value |
Notice the pattern: values like 15, 255, 65535, and 4294967295 are one less than powers of 2 (2⁴, 2⁸, 2¹⁶, 2³²), and their hex representations are all F's. This is why hex is so convenient for representing binary data — every 4 bits maps cleanly to one hex digit.
Where decimal-to-hex conversion is used
Hexadecimal isn't just an academic curiosity — it's used everywhere in computing because it's a compact, human-readable shorthand for binary.
Web design: CSS colors
Every CSS color is written as a hex code like #FF5733. Each pair of hex digits represents the intensity of red, green, and blue (00 to FF). For example, #FF0000 is pure red, #00FF00 is pure green, and #0000FF is pure blue. When you pick a color in a design tool, you're working with hexadecimal.
Memory addresses and debugging
Debuggers, hex editors, and memory viewers display addresses and raw data in hexadecimal. When you inspect a crash dump or a memory leak, the addresses look like 0x7FFE1234 — the 0x prefix tells the reader it's a hex number. This is much more compact than writing 32 binary digits.
Networking: MAC addresses and IPv6
MAC addresses (like 00:1A:2B:3C:4D:5E) are written in hex. IPv6 addresses (like 2001:0db8:85a3:0000:0000:8a2e:0370:7334) use 8 groups of 4 hex digits — much shorter than the full 128-bit binary form. Subnet masks and packet headers are also commonly shown in hex.
Cryptography and hashing
Cryptographic hashes like MD5, SHA-1, and SHA-256 are typically displayed as hex strings. For example, the SHA-256 hash of "hello" is 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824. Each byte of the hash becomes two hex characters, so a 32-byte SHA-256 hash becomes 64 hex characters.
Character encoding: Unicode and UTF-8
Unicode code points are written in hex, like U+0041 for 'A' or U+1F600 for 😀. UTF-8 byte sequences are also shown in hex when debugging encoding issues. Whenever you see a reference to a Unicode character, it's almost always in hexadecimal.
Programming and low-level code
Programmers use hex literals like 0xFF, 0xDEADBEEF, and 0xCAFEBABE for bit masks, flags, sentinel values, and magic numbers. Bitwise operations (AND, OR, XOR, shifts) are much easier to reason about when written in hex because each digit represents exactly 4 bits.
Why use this converter?
Instant results
No server round-trip means your answer appears the moment you click Convert. Zero waiting.
Step-by-step breakdown
See each division by 16, the quotient and remainder at each step, and how the hex number is assembled.
100% private
Everything runs in your browser. The number you enter never leaves your device — no server, no logs, no tracking.
Binary and octal too
Every conversion also shows the binary and octal equivalents, so you get all the common bases in one shot.
No limits
Convert as many numbers as you want. No daily caps, no watermarks, no "upgrade to pro" nonsense.
Works offline
Once the page loads, you can use the converter without an internet connection. Bookmark it for exam prep.
Common mistakes to avoid
- Forgetting to convert remainders 10-15 to A-F. A remainder of 10 must be written as A, 11 as B, and so on. Writing "10" instead of "A" in a hex number is one of the most common errors.
- Reading the remainders in the wrong order. The remainders are collected from the first division (least significant digit) to the last (most significant digit). You must reverse them to get the correct hex number.
- Stopping too early. Keep dividing until the quotient is 0, not until you get a remainder of 0. The quotient hitting 0 is the stopping condition.
- Confusing hex with decimal for numbers 10–15. When you see "15" in a hex context, it might mean the hex digits "1" and "5" (which equal 21 in decimal), or the decimal value 15 (which is F in hex). Context matters — check the notation.
- Mixing up hex and BCD. Hex is a positional base-16 system, while BCD (Binary-Coded Decimal) encodes each decimal digit separately in 4 bits. For example, decimal 12 in hex is C, but in BCD it's 0001 0010.
- Assuming all hex numbers have the same width. Hex numbers have no fixed width unless you specify one. 255 is FF (2 digits), not 00FF (4 digits) — though both represent the same value. This converter shows the minimal representation.