Skip to content

Hex Calculator

Add, subtract, multiply, and divide hexadecimal numbers with instant decimal, binary, and octal output. Enter two hex values such as 0xA and 0x7, then choose an operation.

A + 7 = 0x11

All Representations

Decimal:17
Hex:0x11
Binary:0001 0001
Octal:0o21

Hex Digit to Decimal Reference

00
11
22
33
44
55
66
77
88
99
A10
B11
C12
D13
E14
F15

How Hexadecimal Addition Works

Hex arithmetic follows the same column-by-column rules as decimal, except each column holds 16 possible values (0-F) instead of 10. When a column total reaches 16 or more, you carry 1 into the next column.

Example: Add 0xA + 0x7:

  • 0xA is 10 in decimal, 0x7 is 7 in decimal
  • 10 + 7 = 17, which is larger than 15 (the biggest single hex digit)
  • 17 = 16 + 1, so write 1 and carry 1 to the next column
  • The carried 1 lands in the 16s place, giving 0x11 (17 in decimal)

The same carry logic applies to multiplication, while subtraction borrows 16 from the next column and division returns a quotient plus remainder.

Code Examples

const a = 0xA;
const b = 0x7;
const sum = a + b;               // 17
sum.toString(16);                // "11"
// Large values with BigInt:
BigInt("0xff") * BigInt("0x10"); // 4080n

Frequently Asked Questions

How does hexadecimal addition work?

Hex addition works column by column like decimal, but each column can hold 16 values (0-F). When a column total reaches 16 you carry 1 to the next column. For example, 0xA + 0x7 = 17 in decimal, which is 0x11: you write 1 and carry 1.

Does this hex calculator support the 0x prefix?

Yes. You can type operands with or without the 0x prefix, such as 0xFF or FF. Calculations use BigInt, so very large hex values beyond the 64-bit range are handled exactly with no rounding.

How is hex division handled?

Division returns both the integer quotient and the remainder, since this calculator works with whole numbers. For example, 0xFF ÷ 0x10 = 0xF remainder 0xF. Dividing by zero is blocked with an error message.

Can I see the result in other bases?

Every result is shown in hexadecimal, decimal, binary, and octal at once, so you can copy whichever base your project needs without opening a separate converter.

Related Tools