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.

Hexadecimal
—
Binary
—
Octal
—
Bit Count
—
Hex Digits
—

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

  1. 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.
  2. Click Convert: The converter instantly computes the hexadecimal equivalent and displays it.
  3. 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.
  4. Check the alternatives: The binary and octal equivalents are shown alongside the bit count and number of hex digits.
  5. 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.

Repeated division by 16
Step 1: Divide the decimal number by 16.
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.
Example: convert 255 to hex
255 ÷ 16 = 15 remainder 15 → F ← least significant digit
15 ÷ 16 = 0 remainder 15 → F ← most significant digit

Read bottom to top: FF
Verification (hex to decimal)
FF = F×16¹ + F×16⁰
= 15×16 + 15×1
= 240 + 15
= 255
Hex digits reference
0 = 0 1 = 1 2 = 2 3 = 3
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
000000Zero
110001One bit set
991001Single digit
10A1010First hex letter
15F11114 bits all set
1610100002 hex digits
12880100000001 byte (half)
255FF111111111 byte max value
2561001000000002 bytes (16-bit)
10003E81111101000Common value
409610001000000000000Page size (4KB)
65535FFFF111111111111111116-bit max value
10485761000001000000000000000000001 MB in bytes
16777215FFFFFF11111111111111111111111124-bit max (RGB white)
4294967295FFFFFFFF1111111111111111111111111111111132-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.

Frequently asked questions

Decimal to hexadecimal conversion is the process of converting a base-10 number into its base-16 equivalent. For example, the decimal number 255 becomes FF in hexadecimal.
The standard method is repeated division by 16. Divide the decimal number by 16, record the remainder (0-15, where 10-15 become A-F), then divide the quotient by 16 again. Repeat until the quotient is 0. Read the remainders from bottom to top.
Hexadecimal uses 16 digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F. The letters A through F represent the values 10 through 15.
Hexadecimal is used because it maps cleanly to binary — each hex digit corresponds to exactly 4 bits. This makes it much more compact than binary while still being easy to convert. Programmers use hex for memory addresses, color codes, MAC addresses, and byte values.
This calculator supports decimal numbers up to 4,294,967,295 (2³² − 1), which is the maximum value that fits in 32 bits (or 8 hex digits). For larger numbers, use a dedicated big-integer converter.
CSS colors use hexadecimal notation like #FF5733, where each pair of hex digits represents the red, green, and blue channels (00 to FF). For example, #FF0000 is pure red, and #00FF00 is pure green.
Yes, completely free. No signup, no watermark, no hidden charges. Use it as many times as you want, for homework, work, or personal projects.
Absolutely. Everything runs in your browser using JavaScript. The number you enter never leaves your device — there is no server processing, no logging, and no data storage. Close the tab and it's gone.