Skip to main content

Hex Calculator

Hexadecimal arithmetic (+ − × ÷) with decimal equivalents, step-by-step working, and bitwise operations. Runs 100% in your browser — nothing is uploaded.

This tool: full hexadecimal arithmetic — add, subtract, multiply and divide hex numbers, every result shown in hex and decimal with the working shown, plus bitwise AND, OR, XOR, NOT and bit shifts.

Not this tool: hexadecimal-addition-calculator adds two hex numbers only; hex-dec-oct-bin-converter converts between number bases (no arithmetic); base64-to-hex decodes Base64 text into hex (an encoding tool, no arithmetic).

Worked examples

A5 + 3F = E4
165 + 63 = 228 in decimal, and 228₁₀ = E4₁₆.
FF − 1 = FE
255 − 1 = 254 in decimal, and 254₁₀ = FE₁₆.
10 × 10 = 100 (hex)
Careful: 10₁₆ means sixteen. 16 × 16 = 256 in decimal, and 256₁₀ = 100₁₆.
FF ÷ 10 = F remainder F (hex)
255 ÷ 16 = 15 remainder 15, so the quotient is F₁₆ with remainder F₁₆.

Frequently asked questions

What is a hex calculator?
A hex calculator performs arithmetic directly on hexadecimal (base-16) numbers: addition, subtraction, multiplication and division. This one shows every result in hex and decimal, explains each step, and also handles bitwise operations (AND, OR, XOR, NOT, shifts).
How do I add two hex numbers?
Type both values — the 0x prefix is optional — pick + and calculate. Example: A5 + 3F. A5₁₆ = 165, 3F₁₆ = 63, 165 + 63 = 228, and 228₁₀ = E4₁₆, so A5 + 3F = E4. The steps panel shows this conversion every time.
How does hex subtraction work?
Exactly like decimal subtraction, except each borrow is worth 16 instead of 10. Example: FF − 1 = FE, because 255 − 1 = 254 = FE₁₆. If the second number is larger the result is negative, shown with a minus sign, e.g. 1 − 2 = −1.
How do I multiply hex numbers?
Convert both to decimal, multiply, then convert back. Watch out: 10 in hex means sixteen, not ten. So 10 × 10 = 100 in hex, because 16 × 16 = 256 in decimal and 256₁₀ = 100₁₆.
How does hex division work?
This calculator does integer division and reports both the quotient and the remainder. Example: FF ÷ 10 (hex). 255 ÷ 16 = 15 remainder 15, so the quotient is F and the remainder is F. Dividing by zero shows an honest error.
What is FF minus 1 in hex?
FE. FF₁₆ is 255 in decimal, minus 1 is 254, and 254 in hex is FE.
How do I read the decimal value of a hex result?
Every result shows a decimal companion underneath the big hex answer, and the steps list shows the conversion in both directions — for example 228 (decimal) = 0xE4 (hex).
What do AND, OR and XOR do on hex numbers?
They compare the numbers bit by bit: AND keeps a 1 only where both bits are 1, OR where either is 1, XOR where exactly one is 1. Examples: FF AND 0F = 0F, FF OR 0F = FF, FF XOR 0F = F0. The binary breakdown is shown so you can see why.
How does hex NOT work?
NOT flips every bit, but it needs to know how many bits to flip, so choose a width: 8, 16, 32 or 64. NOT FF at 8-bit is 00; at 16-bit it is FF00. A value that does not fit the chosen width is rejected with an error.
What are hex shifts (<< and >>)?
Shifting moves all bits left or right by a number of positions — the shift count is an ordinary decimal number. 1 << 4 = 10 in hex (16 in decimal); each left shift by one doubles the value. 10 >> 1 = 8 in hex.
Why do programmers use hexadecimal?
One hex digit maps exactly to 4 bits (a nibble), so hex is a compact way to write binary: FF is shorter than 11111111. That is why you see hex in memory addresses, color codes like #FF8000, and low-level debugging.
How is this different from a hex converter or an addition-only tool?
The hexadecimal-addition-calculator adds two hex numbers and nothing else. The hex-dec-oct-bin-converter converts a value between number bases but does no arithmetic. Base64-to-hex decodes an encoding. This tool is the full arithmetic workbench: + − × ÷ with steps, decimal companions, and bitwise operations.

Related tools

Free tool by NRTechStudio