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.
All Representations
170x110001 00010o21Hex Digit to Decimal Reference
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"); // 4080nFrequently 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
Hexadecimal to Decimal Converter
Convert hexadecimal numbers to decimal (base 10) instantly.
Decimal to Hexadecimal Converter
Convert decimal numbers to hexadecimal (base 16) instantly.
Binary Calculator
Add, subtract, multiply, and divide binary numbers with decimal and hex output.
Bitwise Calculator
Perform bitwise operations: AND, OR, XOR, NOT, NAND, NOR - or evaluate full expressions like 0xFF & 0b1010 << 2.