🌐 EN

🔢 Hexadecimal Calculator

Convert nonnegative integers between decimal and hexadecimal and perform hexadecimal arithmetic.

Decimal Input → Hexadecimal

Hexadecimal
—

Hexadecimal Input → Decimal

Decimal
—

Hexadecimal Operations

Result
—
Decimal —

Inputs and checks

  • Type a nonnegative whole number into Decimal Input to see its hexadecimal form. Decimal Input and Hexadecimal Input are separate conversions.
  • Type digits 0 to 9 and letters A to F into Hexadecimal Input; letters display in uppercase. Avoid 0x prefixes because the input is cleaned rather than validated as a prefixed number.
  • For Hexadecimal Operations, enter First Hex Number and Second Hex Number and choose Addition, Subtraction, Multiplication, or Division. Results update as you type or change the operation.
  • Use integers that JavaScript can represent safely; this tool does not preserve arbitrary-length integer precision.

Reading the result

  • Arithmetic results appear in both hexadecimal and decimal. Division rounds the quotient down to a whole number.
  • A negative subtraction result keeps its sign in decimal, but its hexadecimal display shows the absolute value. Division by zero returns 0, not an error.
  • Only hexadecimal values with three or six digits display a color sample. This is not a general color conversion tool.

Examples

Converting 255 and FF

Input
Decimal Input: 255; Hexadecimal Input: FF
Result
Hexadecimal: FF; Decimal: 255
How to check it
255 = 15 × 16 + 15, so its hexadecimal digits are FF.

Multiplying hexadecimal values

Input
First Hex Number: A; Second Hex Number: 5; Operation: Multiplication
Result
Result: hexadecimal 32; decimal 50
How to check it
Hexadecimal A means 10, and 10 × 5 = 50, which is hexadecimal 32.

Frequently asked questions

Can I enter 0xFF?
Enter FF instead. The 0x prefix is not handled as a prefix.
Are very long integers always exact?
No. The calculations use ordinary number precision.
Why does subtraction show a positive hexadecimal result?
Negative differences have their minus sign in the decimal result only.