Hex calculator
Run arithmetic with hexadecimal, binary, octal, or decimal operands and compare the result across bases.
What this calculator covers
Use this calculator to work through hexadecimal arithmetic without losing sight of the underlying decimal value.
Because the result is rendered in four bases at once, it also doubles as a quick cross-check for base-conversion work.
Frequently asked questions
- What is hexadecimal and why is it used in computing?
- Hexadecimal (base 16) uses digits 0–9 and letters A–F to represent values 0–15 in a single character. It maps cleanly onto binary because one hex digit represents exactly four bits, making memory addresses and color codes more compact to read and write.
- Can I enter binary or octal operands instead of hex?
- Yes. The input field accepts the base you select, so you can switch to binary (base 2), octal (base 8), or decimal (base 10) and the arithmetic is performed in that base. The result is then shown in all four bases simultaneously.
- What arithmetic operations does the calculator support?
- Addition, subtraction, multiplication, and division. Division truncates toward zero when the result is not a whole number, consistent with integer arithmetic common in low-level programming contexts.
- How do I read the color code F5A623 as a number?
- Enter F5A623 as the operand with hex selected. The decimal output tells you its base-10 equivalent, and the binary output shows each nibble as four bits — useful when working with bitmasking or color-channel calculations.
Tool
Run the calculation
Result
RESULT · HEX ARITHMETIC
â„–150
Primary result
86 (base 16) = 134 (base 10)
A5 - 1F in hex equals 86 in the selected base and 134 in base 10.
- Selected-base result
- 86 (base 16)
- Binary
- 10000110
- Octal
- 206
- Decimal
- 134
- Hex
- 86
Step-by-step solution
- 1.Interpret A5 and 1F as hex integers, which correspond to 165 and 31 in base 10.
- 2.Apply subtraction in base 10 to get 134.
- 3.Rewrite that same value across the base table so the selected-base result is 86, with binary 10000110, octal 206, decimal 134, and hex 86.
Walkthrough
Visual walkthrough
Base arithmetic becomes transparent when the operands are decoded once, solved once, and then re-encoded into each requested base.
01
Decode the operands
A5 -> 165, 1F -> 31
Each operand is interpreted using the selected radix before any arithmetic is applied.
02
Run the arithmetic once
165 - 31 = 134
The underlying value is the same no matter how the digits are written.
03
Render the result in each base
bin 10000110 | oct 206 | dec 134 | hex 86
Once the value is known, each numeral system is just a different surface encoding of the same quantity.
86 in hex