Conversion

Decimal to hexadecimal converter

Settings
Reset
Share
Save
Embed
Report a bug

Share calculator

Add our free calculator to your website

Please enter a valid URL. Only HTTPS URLs are supported.


Use as default values for the embed calculator what is currently in input fields of the calculator on the page.


Input border focus color, switchbox checked color, select item hover color etc.


Please agree to the Terms of Use.

Preview

Save calculator

Calculator Settings

Please enter a value within the allowed range.

Please enter a value within the allowed range.

Please enter a value within the allowed range.

Please enter a value within the allowed range.

Share calculator

What is the decimal number system?

The decimal number system, also called the base-10 system, is the most commonly used numbering system in daily life. It uses ten digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. Each digit in a number represents a power of ten, depending on its position.

For example, in the number 427, the digit 7 represents 7×1007 \times 10^0, the 2 represents 2×1012 \times 10^1, and the 4 represents 4×1024 \times 10^2. Adding all together, we get:
427=4×100+2×10+7×1427 = 4 \times 100 + 2 \times 10 + 7 \times 1.

This positional value concept forms the basis of all number systems.

What is the hexadecimal number system?

The hexadecimal number system, or base-16 system, uses sixteen possible symbols for each digit: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F.
Here, the letters represent the decimal numbers 10 through 15:

  • A = 10
  • B = 11
  • C = 12
  • D = 13
  • E = 14
  • F = 15

This system is compact and efficient. It is especially important in computing and digital electronics, where binary numbers (base 2) are used internally. A single hexadecimal digit corresponds exactly to four binary digits (bits), making conversions easy.

For example, the hexadecimal number 2F equals 2×161+F×160=2×16+15=472 \times 16^1 + F \times 16^0 = 2 \times 16 + 15 = 47 in decimal form.

Formula

To convert a decimal number into a hexadecimal one, repeated division by 16 is used.
Each time, the remainder represents one hexadecimal digit, starting from the least significant position (rightmost digit).

Let a decimal number NN be given. Divide NN by 16 until the quotient becomes zero.
The relationship can be summarized as:

N=(rk×16k)+(rk1×16k1)+...+(r1×161)+(r0×160)N = (r_k \times 16^k) + (r_{k-1} \times 16^{k-1}) + ... + (r_1 \times 16^1) + (r_0 \times 16^0)

Where:

  • rir_i is the remainder obtained at each division step (converted to hexadecimal symbol if needed)
  • The final hexadecimal number is read from bottom remainder to top remainder

Step-by-step example: Convert 256 (decimal) to hexadecimal

To understand the process more clearly, let’s follow each division step:

Decimal ÷ 16QuotientRemainder
256 ÷ 16160
16 ÷ 1610
1 ÷ 1601

Now, starting from the bottom remainder and moving upward gives us:
100₁₆ (hexadecimal representation of 256).

So 25610=10016256_{10} = 100_{16}.

Example 2: Convert 43981 (decimal) to hexadecimal

Decimal ÷ 16QuotientRemainder
43981 ÷ 16274813 (D)
2748 ÷ 1617112 (C)
171 ÷ 161011 (B)
10 ÷ 16010 (A)

Reversing the remainders: ABCD₁₆

Thus, 4398110=ABCD1643981_{10} = ABCD_{16}.

Quick conversion tips

  1. Divide the decimal number by 16 repeatedly.
  2. Record the remainder each time – convert values 10–15 into A–F.
  3. Reverse the order of collected remainders to get the final hexadecimal value.
  4. For very large numbers, using a calculator is much faster and avoids manual errors.

Applications of the hexadecimal system

  1. Computing and programming: Hexadecimal numbers represent memory addresses and color codes.
    For example, the color code #FF0000 represents pure red.
    The three pairs (FF, 00, 00) show red, green, and blue intensity in hexadecimal.
  2. Digital electronics: Used for data representation in binary systems; shortened hexadecimal form simplifies binary sequences.
  3. Networking: MAC addresses and IPv6 addresses use hexadecimal notation for compactness.
  4. Debugging systems: Software engineers use hex dumps to view binary data in readable form.

Frequently asked questions

How to convert 500 in decimal to hexadecimal manually?

Divide 500 repeatedly by 16:

Decimal ÷ 16QuotientRemainder
500 ÷ 16314
31 ÷ 16115 (F)
1 ÷ 1601

Reading from bottom: 1F4₁₆.
50010=1F416500_{10} = 1F4_{16}.

How many hexadecimal digits are needed to represent a byte?

A byte equals 8 bits, and each hexadecimal digit equals 4 bits.
Therefore, 8÷4=28 ÷ 4 = 2 digits.
One byte is represented by exactly two hexadecimal characters.

How to check if a hexadecimal number is valid?

Verify that all characters belong to: 0–9 and A–F.
Any other character (like G or Z) is not valid in hexadecimal representation.

What is the largest hexadecimal number that fits in a single byte?

A byte = 8 bits = 281=2552^8 - 1 = 255 in decimal.
The hexadecimal equivalent of 255 is FF₁₆.

Why is hexadecimal preferred over binary in programming?

Binary numbers are long and hard to read. Hexadecimal condenses them, using 1 hex digit per 4 binary bits, making reading and debugging far more efficient. For instance, the binary string 11111111 becomes simple FF₁₆.

Report a bug

This field is required.