Code tool

Hex Calculator

Enter two hexadecimal integers to calculate an exact sum or difference and see the result in hexadecimal and decimal.

In-browser processingNo account requiredPrivacy details ↗

Use an optional 0x prefix and optional sign; 1–256 hexadecimal digits per value.

A QUICK WALKTHROUGH

How to use this tool

  1. Enter signed hexadecimal values A and B, optionally using 0x.
  2. Choose addition or subtraction.
  3. Calculate to view canonical hexadecimal and decimal output.

Input range

Each value accepts an optional + or − sign, an optional 0x prefix, and 1–256 hexadecimal digits. Whitespace, separators, decimals, and expressions are rejected.

Exact output

BigInt performs the addition or subtraction exactly. Hex output uses an optional leading minus sign, 0x, and uppercase digits; decimal output is signed base 10.

Private local processing

Validation and calculation run in your browser. Values are not uploaded or stored by this page.

GOOD TO KNOW

Common questions

Can I use lowercase digits?

Yes. Input is case-insensitive; the result is displayed with uppercase hexadecimal digits.

What is the largest input?

Each operand may contain 1–256 hexadecimal digits, with an optional sign and 0x prefix.

Does this evaluate expressions?

No. The calculator parses one hexadecimal integer per field and never evaluates code or expressions.