Skip to content

Hex Calculator

Enter two whole numbers in the base you choose and pick an operation. The answer is shown in hexadecimal, decimal, binary and octal.

Result

Hexadecimal
1AF6
Decimal
6902
Binary
1101011110110
Octal
15366
First number in decimal
6719
Second number in decimal
183

Formula

  • Hex digits: 0 to 9 and A to F, where A = 10 and F = 15
  • Carry in hex addition when a column reaches 16
  • AND gives 1 where both bits are 1, OR where either is 1, XOR where exactly one is 1

How the Hex Calculator works

Hexadecimal arithmetic works like decimal arithmetic, except each column counts to 15 before carrying. Adding F and 1 gives 10 in hex, which is 16 in decimal.

Bitwise operations compare two numbers bit by bit. They are used to set, clear and test individual flags in programming, and XOR is the basis of many checksums and simple ciphers.

Worked example

1A3F + B7 in hex: 1A3F is 6,719 and B7 is 183 in decimal. Their sum is 6,902, which is 1AF6 in hexadecimal.

Frequently asked questions

How do I add hexadecimal numbers by hand?

Add column by column from the right. If a column totals 16 or more, subtract 16, write the remainder and carry 1 to the next column.

What is FF in decimal?

FF is 15 × 16 + 15 = 255, the largest value of one byte.

Related calculators

All text, code and network calculators · All calculators

Related unit converters

Calculations run in your browser and nothing you enter is sent to a server. Results are provided for general information. Check critical figures independently before relying on them.

☕ Like this tool?

Buy me a coffee to support development

☕ Support UnitGenie

If this tool has been helpful, consider buying me a coffee to support development and keep it free for everyone!