Hex Calculator: Add and Convert to Decimal

This hex calculator adds, subtracts, multiplies and divides hexadecimal numbers and converts the answer to decimal and binary. Type values like 1A3F or 0xFF, choose an operation, and see the result in each base, which is useful for programming, memory addresses and color codes.

Hex Calculator

Hexadecimal

-

Decimal

-

Binary

-

Octal

-

This hex calculator adds, subtracts, multiplies and divides hexadecimal numbers, and converts any hex value to decimal, binary and octal. It's useful for programming, memory addresses, color codes and computer science homework.

Hex calculator: add, subtract and convert hexadecimal

A hex calculator does math in base 16, where the digits run 0–9 and then A–F for 10 to 15. Enter two hex values and pick an operation, and it shows the answer in hex, decimal, binary and octal. For example, FF in hex equals 255 in decimal and 11111111 in binary.

How to use the Hex Calculator

  1. Choose a Mode: Hex Arithmetic or Convert Hex → Dec / Bin.
  2. For arithmetic, enter Hex A and Hex B and pick Add, Subtract, Multiply or Divide. For conversion, enter one Hexadecimal Value.
  3. Use digits 0–9 and A–F, in upper or lower case. A 0x prefix and a leading minus sign are accepted.
  4. Press Calculate and read the result in Hexadecimal, Decimal, Binary and Octal.

Formula

Hex digits: 0–9 = 0–9, A = 10, B = 11, C = 12, D = 13, E = 14, F = 15
Value = sum of digit × 16^position (rightmost position = 0)

Each hex digit stands for exactly four binary digits, which is why programmers use hex as shorthand for binary. Division keeps only the whole-number part of the answer.

Example

1A + 2F: 1A = 1 × 16 + 10 = 26, and 2F = 2 × 16 + 15 = 47. 26 + 47 = 73, which is 49 in hex (4 × 16 + 9), 1001001 in binary and 111 in octal. In convert mode, FF = 15 × 16 + 15 = 255, or 11111111 in binary.

Frequently asked questions

How do I convert hex to decimal?

Multiply each digit by 16 raised to its position, counting from 0 on the right, and add the results. 3B = 3 × 16 + 11 = 59.

What does 0x mean in front of a number?

0x is a prefix used in programming to mark a number as hexadecimal, so 0x1F means hex 1F, which is 31 in decimal. You can type values here with or without the 0x.

What happens when I divide hex numbers?

The tool does integer division and drops any remainder. For example, 64 ÷ 3 in hex (100 ÷ 3 in decimal) gives 21 in hex, which is 33 in decimal.

Why is hexadecimal used in computing?

One hex digit maps to exactly four bits, so a byte is always two hex digits, from 00 to FF. That makes long binary values much shorter and easier to read, as in color codes like #FF8800.

How do I add two hex numbers?

Add digit by digit from the right, carrying 1 whenever a column reaches 16. For example, A + 7 = 17 in decimal, which is 11 in hex: write 1 and carry 1.

What is FF in decimal?

FF = 15 × 16 + 15 = 255. It is the largest value one byte can hold, which is why it appears in web color codes like #FFFFFF for white.

For binary arithmetic and base conversions from decimal, use the Binary Calculator.

Hex arithmetic and hex to decimal

How to use it

  1. Enter the first hex number, with or without 0x.
  2. Pick add, subtract, multiply or divide.
  3. Enter the second hex number.
  4. Read the answer in hex, decimal and binary.

More questions

What is 0xFF in decimal?

255.

How do I convert decimal to hex?

Divide by 16 again and again and write the remainders in reverse, using A to F for 10 to 15. 255 becomes FF.

Is a hex color code the same as a hex number?

Yes. #FF8800 is three hex numbers for red, green and blue. Use the HEX to RGB Converter for colors.

Related tools: HEX to RGB Converter, Number Base Converter, Binary Calculator.

Adding hex values and counting bytes

In arithmetic mode, type two hex values, pick add, subtract, multiply or divide and read the answer in hex, decimal, binary and octal. In convert mode, type one hex value to see its other forms. To see text as binary, use the Text to Binary Converter.

Worked example: 3E8 + 1F4 = 5DC, which is 1,000 + 500 = 1,500 in decimal, 10111011100 in binary and 2734 in octal. Converting C0FFEE gives 12,648,430 in decimal.

More answers

How many bits and bytes are in a hex value like C0FFEE?

Each hex digit stands for 4 bits, so two digits make one byte. C0FFEE has 6 digits, which is 3 bytes or 24 bits, and its binary form 110000001111111111101110 is exactly 24 digits long.

How do I check a hex addition by hand?

Convert both values to decimal, add them, then convert back. 3E8 is 1,000 and 1F4 is 500; their sum 1,500 is 5 × 256 + 13 × 16 + 12, which is 5DC.