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 entered1A16 + 2F16\mathrm{1A}_{16}\ +\ \mathrm{2F}_{16}

1A16 + 2F16=4916\displaystyle \mathrm{1A}_{16}\ +\ \mathrm{2F}_{16} = \mathrm{49}_{16}

Decimal

26+47=73\displaystyle 26 + 47 = 73

Binary

10010012\displaystyle \mathrm{1001001}_{2}
Show the work
  1. Hex addition with carries

    Add the columns from the right. A column whose total reaches 16 writes the total less 16 and carries 11 into the next column on the left, with 10 to 15 written as A to F. The small 11 marks each carry.

    11A+2F49\begin{array}{rccc} & & {\scriptstyle 1} & \\ & & 1 & A \\ + & & 2 & F \\ \hline & & 4 & 9 \end{array}
  2. Check in decimal

    Converting both numbers to decimal, adding, and converting back should give the same result.

    1A16+2F16=26+47=73=4916\begin{aligned} \mathrm{1A}_{16} + \mathrm{2F}_{16} &= 26 + 47 \\ &= 73 \\ &= \mathrm{49}_{16} \end{aligned}
  3. Result

    So 1A16 + 2F16=4916\mathrm{1A}_{16}\ +\ \mathrm{2F}_{16} = \mathrm{49}_{16}.

Worked examples