Number base conversion

Decimal to Hex Calculator

Convert a nonnegative whole number from decimal (base 10) to hexadecimal (base 16).

Base 10 input

Enter a nonnegative integer

Base 10 → 16
Use up to 1,000 decimal digits; leading zeroes are allowed.
Base 16 output

Hexadecimal equivalent

The hexadecimal value will appear here

Enter decimal digits 0 through 9; the result uses 0–9 and A–F.

What Is Decimal to Hexadecimal Conversion?

The Decimal to Hex Calculator converts a nonnegative base-10 integer into exact hexadecimal notation. Enter up to 1,000 decimal digits. The main Hexadecimal value card shows the uppercase result, while the smaller Decimal input card preserves the entered value.

Hexadecimal uses digits 0–9 and letters A–F for values 10–15. Here decimal means base 10, not permission to enter a fractional number. This tool accepts unsigned integers only and does not choose a signed format, fixed width or byte order.

How to Convert a Decimal Integer to Hex

  1. Enter the integer in Decimal number, using ordinary digits 0 through 9.
  2. Use no grouping commas, spaces, sign, point or exponent notation. Zero and leading zeroes are allowed within the 1,000-digit limit.
  3. Select Convert to hexadecimal. Read the main Hexadecimal value result.
  4. Check Decimal input to confirm the original entry. This card repeats its digit representation, including leading zeroes supplied in the form.
  5. For a manual check, divide the decimal integer by 16 repeatedly, record the remainders, and read their hex digits from last to first.

The page returns an unprefixed uppercase hex integer. It has no fractional-input mode, signed word-size selector, colour formatter, generated division table or reverse-conversion field. Related tools can express the hex result in other bases within their own limits.

Division by Sixteen and Hex Remainder Rules

N = 16 × q + r, where q = floor(N ÷ 16) and 0 ≤ r < 16

Hex digits = successive remainder symbols read from last to first

Each division extracts the next hex digit from the right. Remainders 0–9 keep their written digits; 10–15 become A–F. Continue with the integer quotient until it reaches zero. McMaster’s number-system notes explain base conversion and hexadecimal digits.

You can check the result using powers of sixteen: the rightmost place has weight 1, then 16, 256, 4096 and so on. NPTEL’s positional-number explanation describes these weights.

The controller performs decimal long division on digit strings rather than converting the entire input to a fixed-size floating-point number. The returned hex string is displayed directly, preserving exact digits within the input length. Zero returns one 0.

The original Decimal input card is separate from the normalized hex result. Leading zeroes can remain in that repeated input while disappearing from the result’s numerical representation. No 0x prefix or minimum width is added.

Decimal Input, Remainders and Hex Result

Decimal number / Decimal input
The original base-10 unsigned integer, repeated in the result area. Up to 1,000 digits; input padding is retained in the Decimal input card.
Quotient q / remainder r
Intermediate integer quantities in repeated division. Each remainder from 0 to 15 identifies one hex digit; these are explanation terms rather than result cards.
Hexadecimal value / Hexadecimal integer
The same exact normalized base-16 output, using uppercase A–F with no prefix or fixed-width padding.

Decimal to Hexadecimal Division Example

Illustrative example. Enter decimal 6843. Dividing by 16 gives quotient 427 and remainder 11, represented by B. Next, 427 divided by 16 gives quotient 26 and remainder 11, another B.

Then 26 divided by 16 gives quotient 1 and remainder 10, represented by A. Finally, 1 divided by 16 gives quotient 0 and remainder 1. Read the symbols backward to get 1ABB.

Verify the value: 1×4096 + 10×256 + 11×16 + 11 = 4096+2560+176+11 = 6843. Both hex-result locations display 1ABB, and Decimal input displays 6843.

Calculation check. Independent integer division, positional reconstruction, Python conversion and the endpoint agree. Entering 0006843 keeps that padded decimal text in Decimal input but still gives normalized hex 1ABB.

Example details. Review the inputs and results under the stated rules.

Repeated division for decimal 6843; read remainder symbols upward
Current valueQuotient ÷16Remainder symbol
684342711 → B
4272611 → B
26110 → A
101

Remainder Letters, Leading Zeroes and Exact Digits

Remainders 10 through 15 each need one hex digit. Writing them as two decimal digits would break the base-16 representation. The mapping below gives the six letter symbols.

Decimal remainder values and their hexadecimal symbols
RemainderHex symbol
10A
11B
12C
13D
14E
15F

The first remainder is the rightmost digit. For 6843, the found sequence B, B, A, 1 must be read backward to obtain 1ABB. Expanding 1ABB as powers of sixteen independently checks that order.

The returned hex integer is normalized, while the repeated Decimal input card can retain input padding such as 006843. Exact conversion preserves value, not an assumed register width. Very long results remain digit strings; another application may apply a different precision or input-length limit.

How to Read the Hexadecimal Integer

Read letters as digit values within base 16. In 1ABB, A contributes 10 in its position and each B contributes 11. The output is one integer, not a word or a sequence of ASCII codes.

Remainder order matters. The first remainder belongs at the right of the final result. Writing the remainders in their discovery order would reverse the intended positions. Zero remainders must also keep their places.

A larger written base can use fewer digits for the same value. Decimal 16 becomes hex 10, while decimal 256 becomes hex 100. Neither output should be interpreted as an ordinary decimal integer.

This converter handles unsigned integer magnitude. It does not encode negative numbers in two’s complement, enforce a register width, reverse bytes or add colour syntax. Those tasks need additional rules and inputs.

The exact long output stays a digit string on this page. A 1,000-digit decimal input can require up to 831 hex digits. The related hex converters accept up to 1,000 hex digits, but their resulting binary or octal values may in turn exceed another tool’s input length. Keep the original value when moving data between applications.

Common Decimal to Hex Mistakes

  • Entering a decimal fraction because the page name says decimal.
  • Pasting grouping commas, a sign or exponent notation into the digit-only field.
  • Rounding the quotient instead of using integer division.
  • Reading remainder symbols from first to last.
  • Dropping zero remainders from the result.
  • Interpreting A–F as text characters or the output as decimal.
  • Expecting a signed, byte-ordered, fixed-width or colour representation.

Decimal to Hex Questions

How do I convert decimal to hexadecimal?

Divide the integer by 16 repeatedly, keep each remainder and read the remainder symbols from last to first. Remainders 10–15 become A–F.

Does this accept fractional decimals?

No. Decimal identifies base 10 here. Enter a nonnegative whole-number digit string without a point or exponent.

Why do letters appear in the result?

Hexadecimal needs sixteen digit values. A, B, C, D, E and F stand for decimal 10, 11, 12, 13, 14 and 15.

Can I enter zero or leading zeroes?

Yes. Zero gives 0. Leading zeroes remain in the repeated decimal-input card but do not change the normalized hex value.

Will a large integer lose precision?

The converter uses exact digit-string division and displays the hex string directly within its accepted input length. Another application may have different precision limits.

Does it add 0x or a fixed number of hex digits?

No. The output uses uppercase digits without a prefix or fixed-width padding.

Can I convert a negative number to a signed hex format?

No. This form accepts unsigned integers and has no word-size or two’s-complement mode.

Can I check the result in binary or octal?

Yes. The related Hex to Binary and Hex to Octal calculators express that same unsigned value in other bases. Their own input/output length limits still apply.

Sources and References