Decimal to Hex Converter
Convert a decimal integer to hexadecimal instantly with an exact base-10 to base-16 converter. Enter any non-negative whole number to get its uppercase hex value, digit count, division steps, and verified examples.
What Is a Decimal to Hex Converter?
A decimal to hex converter changes an integer from the decimal number system (base 10) into the equivalent hexadecimal number system (base 16). Decimal uses the digits 0 through 9, while hexadecimal requires sixteen digit values.
Hexadecimal uses the familiar decimal digits 0–9 for values zero through nine, then uses the letters A, B, C, D, E, and F for decimal values 10, 11, 12, 13, 14, and 15.
Hex is widely used in computing because one hexadecimal digit represents exactly four binary bits. This makes long binary patterns shorter and easier for people to read without losing their exact bit structure.
Decimal — Base 10
Uses digits 0 through 9 with place values based on powers of ten.
Hexadecimal — Base 16
Uses 0–9 and A–F with place values based on powers of sixteen.
How to Use the Decimal to Hex Converter
Type a whole number such as 255. This tool accepts
non-negative decimal integers.
BinaryCon converts the value exactly and displays uppercase hexadecimal letters A–F where needed.
The result card shows the exact base-16 representation and the number of hexadecimal digits required.
For smaller values, the calculator shows repeated division by 16 and the remainders that produce the hexadecimal digits.
Use the hex value in code, digital systems, debugging, color work, documentation, or another BinaryCon converter.
How Decimal to Hex Conversion Works
The standard manual method uses repeated division by 16. Divide the decimal number by 16, record the remainder, then divide the quotient by 16 again. Continue until the quotient is zero.
Remainders 0 through 9 are written as ordinary digits. Remainders 10 through 15 become A through F.
| Decimal Value | Hex Digit |
|---|---|
| 0–9 | 0–9 |
| 10 | A |
| 11 | B |
| 12 | C |
| 13 | D |
| 14 | E |
| 15 | F |
Worked Example: Convert Decimal 255 to Hex
Example: Convert Decimal 45 to Hex
Decimal to Hex Conversion Table
| Decimal | Hex | Decimal | Hex |
|---|---|---|---|
| 0 | 0 | 8 | 8 |
| 1 | 1 | 9 | 9 |
| 2 | 2 | 10 | A |
| 3 | 3 | 11 | B |
| 4 | 4 | 12 | C |
| 5 | 5 | 13 | D |
| 6 | 6 | 14 | E |
| 7 | 7 | 15 | F |
| 16 | 10 | 31 | 1F |
| 32 | 20 | 63 | 3F |
| 64 | 40 | 127 | 7F |
| 128 | 80 | 255 | FF |
| 256 | 100 | 4095 | FFF |
| 4096 | 1000 | 65535 | FFFF |
Important Powers of 16
| Power | Decimal Value | Hex Value |
|---|---|---|
| 16⁰ | 1 | 1 |
| 16¹ | 16 | 10 |
| 16² | 256 | 100 |
| 16³ | 4,096 | 1000 |
| 16⁴ | 65,536 | 10000 |
| 16⁵ | 1,048,576 | 100000 |
| 16⁶ | 16,777,216 | 1000000 |
Why Hexadecimal Uses A Through F
A base-16 system needs sixteen digit symbols. The decimal digits 0 through 9 provide only ten symbols, so six additional symbols are needed.
Hexadecimal therefore uses:
B = 11
C = 12
D = 13
E = 14
F = 15
These letters are numerical digits in hexadecimal notation, not variables.
Why Decimal 255 Equals FF in Hex
Decimal 255 is a particularly common value in computing. In hexadecimal:
The value also corresponds to binary 11111111, making FF
the largest value representable by one unsigned 8-bit byte.
How Hex Relates to Binary
Hexadecimal is closely related to binary because 16 = 2⁴. Every hexadecimal digit maps directly to four binary bits.
| Hex | Binary | Hex | Binary |
|---|---|---|---|
| 0 | 0000 | 8 | 1000 |
| 1 | 0001 | 9 | 1001 |
| 2 | 0010 | A | 1010 |
| 3 | 0011 | B | 1011 |
| 4 | 0100 | C | 1100 |
| 5 | 0101 | D | 1101 |
| 6 | 0110 | E | 1110 |
| 7 | 0111 | F | 1111 |
What Does 0x Mean Before a Hex Number?
In programming languages and technical documentation, hexadecimal values
are often written with a 0x prefix. For example:
The prefix identifies the following digits as hexadecimal. It is not part
of the numeric value itself. BinaryCon returns the clean hexadecimal digits
without the prefix so you can add 0x only where your syntax
requires it.
Uppercase vs Lowercase Hexadecimal
Hexadecimal letters may be written in uppercase or lowercase. For example,
FF and ff represent exactly the same numeric value.
BinaryCon uses uppercase A–F consistently because that style is common in conversion tables and makes letter digits easy to distinguish.
Where Decimal to Hex Conversion Is Used
Programming
Hexadecimal is commonly used for constants, masks, flags, byte values, low-level data, and debugging.
Web colors
RGB channel values are often written as hexadecimal pairs in color codes
such as #FF0000.
Memory and machine data
Addresses, hex dumps, byte sequences, registers, and binary data are often easier to inspect in hexadecimal than in long binary strings.
Digital electronics
Hex provides a compact representation for groups of four binary bits in registers, buses, and digital systems.
Common Decimal to Hex Conversion Mistakes
Hexadecimal digit A represents decimal 10. Hex 10 actually
means decimal 16.
In repeated division by 16, remainders must be read from the last division back to the first.
Remainders 10 through 15 must be replaced by A through F.
Hex digits use base-16 place values. FF₁₆ equals decimal 255.
Related BinaryCon Tools
Reverse the conversion or work with the same decimal value in binary, octal, hexadecimal, or BCD.
Decimal to Hex Converter FAQs
How do you convert decimal to hexadecimal?
Divide the decimal integer repeatedly by 16 and record each remainder. Replace remainder values 10 through 15 with A through F. When the quotient reaches zero, read the remainders from bottom to top to obtain the hexadecimal result.
What is decimal 10 in hex?
Decimal 10 is hexadecimal A. Hex uses A for 10, B for 11, C for 12, D for 13, E for 14, and F for 15.
What is decimal 45 in hexadecimal?
Decimal 45 equals 2D₁₆. The calculation is 2 × 16 + 13 = 32 + 13 = 45, and decimal 13 is hexadecimal D.
What is decimal 255 in hexadecimal?
Decimal 255 equals FF₁₆. Each F represents 15, so FF equals 15 × 16 + 15 = 255.
What is decimal 4095 in hexadecimal?
Decimal 4095 equals FFF₁₆. Since 4095 = 16³ – 1, all three lower hexadecimal digit positions are F.
Why does hexadecimal use letters?
Base 16 needs sixteen distinct digit values. Decimal digits provide only ten symbols, so hexadecimal uses A through F for the remaining six values 10 through 15.
Is hex 10 equal to decimal 10?
No. Hexadecimal 10₁₆ equals decimal 16 because it represents
one group of 16 and zero ones. Decimal 10 is hexadecimal A.
What does 0xFF mean?
The prefix 0x is commonly used in programming to indicate a
hexadecimal literal. 0xFF therefore means hexadecimal FF,
which equals decimal 255.
Can hexadecimal letters be lowercase?
Yes. Uppercase and lowercase forms have the same numeric meaning:
FF and ff are equal. BinaryCon outputs uppercase
letters for consistency.
Why is hex useful for binary data?
One hexadecimal digit represents exactly four binary bits because 16 = 2⁴. This makes hex a compact and exact shorthand for long binary sequences.
Can this converter handle very large decimal integers?
Yes. It uses JavaScript BigInt for whole-number conversion, so large non-negative integers can be converted exactly without ordinary floating-point safe-integer rounding.
Can I convert negative decimal values to hex here?
This page converts non-negative decimal integers to unsigned hexadecimal magnitude. Negative machine integers depend on a selected signed representation and fixed width, such as an 8-bit, 16-bit, or 32-bit two’s-complement value.
Does this converter support decimal fractions?
This tool is designed for whole-number integers. Fractional decimal-to-hex conversion requires repeated multiplication of the fractional part by 16, and some fractions produce repeating hexadecimal expansions.
Convert Decimal Numbers to Hex Instantly
Use BinaryCon for exact decimal-to-hex conversion, verified division examples, hexadecimal reference tables, and practical number-system tools without registration.