Hex Calculator

Add, subtract, multiply and divide hexadecimal numbers, with decimal and binary equivalents.

Digits 0-9 and A-F (upper or lower case); an 0x prefix is accepted.

Digits 0-9 and A-F (upper or lower case); an 0x prefix is accepted.

Number entry: use a point for decimals (1.5). Commas grouped in threes are thousands separators (1,250), and a single comma such as 1,5 is read as a decimal comma. Nothing you enter leaves your device.

Showing the example values. Change the inputs and press Calculate for your own result.

1F4 + A3 =

297

In decimal
500 + 163 = 663

Negative numbers are written with a minus sign (for example −101), not in two's complement.

About the hex calculator

The hex calculator adds, subtracts, multiplies and divides hexadecimal (base 16) numbers and converts between hex and decimal. Each result also appears in decimal and binary.

Hexadecimal is common in programming, web colours, memory addresses and debugging, because each hex digit maps neatly to four bits.

Who should use the hex calculator

  • Programmers and web developers.
  • Students of computer science and electronics.
  • Anyone decoding colour codes or memory addresses.

How to use the hex calculator: what each input means

Operation
Add, subtract, multiply, divide, or convert between hexadecimal and decimal.
Hex numbers
Digits 0–9 and letters A–F in either case. A leading 0x and spaces are ignored.

How the hex calculator works: method and formula

Each hexadecimal string is converted to an exact integer, the operation is performed with arbitrary-precision arithmetic and the result is converted back. Hex digit values are A = 10, B = 11, C = 12, D = 13, E = 14 and F = 15.

Hex to decimal
d = Σ digit × 16^position (position 0 is the rightmost digit)

How to read your hex calculator result

Check the decimal and binary forms if you are verifying code. Each hex digit equals four binary bits, so 0x1F4 is 0001 1111 0100.

Hex Calculator worked example

Add 1F4 and A3 in hexadecimal.

  1. 1F4 = 1×256 + 15×16 + 4 = 500.
  2. A3 = 10×16 + 3 = 163.
  3. 500 + 163 = 663, which is 297 in hex.

1F4 + A3 = 297 (decimal 663).

Practical uses of the hex calculator

  • Working with CSS colour values and memory offsets.
  • Converting hex to decimal when debugging.
  • Checking arithmetic on register values.

Assumptions and limitations of this calculator

  • Unsigned magnitudes with an optional minus sign; fixed-width overflow and two's complement are not modelled.
  • Hexadecimal fractions are not accepted in input.
FAQs

Hex Calculator FAQs

A to F stand for 10 to 15, so each hex digit holds one of 16 values.

Need Something Built Around Your Numbers?

Code & Motions designs and builds custom calculators, dashboards and web tools for businesses. Tell us what you have in mind.