Hex Calculator

Enter two hex numbers and choose an operation.

Operation

AND, OR and XOR compare the numbers digit by digit.

Digits 0–9 and A–F, with an optional 0x; a leading minus sign is allowed.

Digits 0–9 and A–F, with an optional 0x; a leading minus sign is allowed.

Try

Result

You enteredA16 × B16\mathrm{A}_{16}\ \times\ \mathrm{B}_{16}

A16 × B16=6E16\displaystyle \mathrm{A}_{16}\ \times\ \mathrm{B}_{16} = \mathrm{6E}_{16}

Decimal

10×11=110\displaystyle 10 \times 11 = 110

Binary

11011102\displaystyle \mathrm{1101110}_{2}
Show the work
  1. Hex to decimal

    Each hex digit is worth a power of 1616, counting from 00 at the right, with A to F standing for 10 to 15. Converting both numbers to decimal lets the operation be done with ordinary arithmetic.

    Using N=dk 16k+⋯+d1 16+d0N = d_{k}\,16^{k} + \cdots + d_{1}\,16 + d_{0}

    A16=10×160=10B16=11×160=11\begin{gathered} \mathrm{A}_{16} = 10 \times 16^{0} = 10 \\ \mathrm{B}_{16} = 11 \times 16^{0} = 11 \end{gathered}
  2. Multiplication in decimal

    Work out the operation on the decimal values.

    10×11=11010 \times 11 = 110
  3. Decimal to hex

    Divide by 1616 again and again, keeping each remainder, until the quotient is 00. The remainders read from the last to the first are the hex digits, with 10 to 15 written as A to F.

    Using N=16×q+r,0≤r<16N = 16 \times q + r, \quad 0 \le r < 16

    110=16×6+14(14→E)6=16×0+6\begin{array}{l} 110 = 16 \times 6 + 14 \quad \left(14 \to \mathrm{E}\right) \\ 6 = 16 \times 0 + 6 \end{array}
  4. Result

    So A16 × B16=6E16\mathrm{A}_{16}\ \times\ \mathrm{B}_{16} = \mathrm{6E}_{16}.

Worked examples