Hex & Binary Arithmetic Calculator
Add or subtract two hexadecimal or binary numbers and instantly read the result in hex, binary, and decimal.
Radix (base)
Operation
Exact value computed with BigInt arithmetic
How does this calculator work?
Choose hexadecimal or binary, enter two operands, and pick add or subtract. The calculator parses them as exact BigInt integers, computes A + B or A − B, and shows the result in hex, binary, and decimal at once — plus a two’s-complement form whenever subtraction yields a negative value.
Formula
How this is calculated
Pick the radix (base 16 for hexadecimal or base 2 for binary), then type the two operands using digits valid for that base. An optional 0x or 0b prefix and spaces or underscores are ignored, and a leading minus sign denotes a negative operand. Both operands are parsed into arbitrary-precision BigInt integers, so even very long inputs are exact with no floating-point rounding.
The operation applies plain integer arithmetic: addition (A + B) or subtraction (A − B). The single result value is then re-encoded in three bases simultaneously — hexadecimal (base 16), binary (base 2), and decimal (base 10) — so you can read whichever representation you need without a separate conversion step.
When subtraction produces a negative result, the calculator also reports the fixed-width two’s-complement form: it picks the smallest multiple of 8 bits that can hold the value with a sign bit, then shows (2^width + result) in both hex and binary. This mirrors how signed integers are actually stored in hardware. Inputs containing characters that are not valid for the chosen base are rejected and no result is shown.
Frequently asked questions
No — both operands must use the radix you select. Convert one operand first if your sources differ, or run the calculation twice with the matching base.
The decimal, hex, and binary outputs use a leading minus sign. In addition, a fixed-width two’s-complement form is shown so you can see exactly how the value would appear in an 8-, 16-, or 32-bit signed register.
Yes. Arithmetic uses BigInt, which has unlimited integer precision, so hex and binary results stay exact regardless of length. Only the decimal hero card may round extremely large magnitudes for display.
Also known as
TG we-Calculate Editorial Team. (2026). Hex & Binary Arithmetic Calculator [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/hex-binary-arithmetic-calculator
TG we-Calculate Editorial Team. "Hex & Binary Arithmetic Calculator." TG we-Calculate. 2026. https://we-calculate.com/calculator/hex-binary-arithmetic-calculator.
TG we-Calculate Editorial Team, "Hex & Binary Arithmetic Calculator," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/hex-binary-arithmetic-calculator
@misc{wecalculate_hex_binary_arithmetic_calculator, title = {Hex & Binary Arithmetic Calculator}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/hex-binary-arithmetic-calculator}}, year = {2026}, note = {TG we-Calculate} }
Did this calculator help you?
