Hex Calculator
Perform hex arithmetic and convert between binary, octal, decimal, and hexadecimal instantly.
Result (Hex)
—
Decimal
—
Binary
—
Binary (base 2)
—
Octal (base 8)
—
Decimal (base 10)
—
Hexadecimal (base 16)
—
What is Hex Calculator?
A hex calculator lets you add, subtract, multiply, and divide hexadecimal (base-16) numbers, and also convert any number between binary (base-2), octal (base-8), decimal (base-10), and hexadecimal. Hex is widely used in programming, color codes, memory addresses, and digital systems because it compactly represents binary data — one hex digit equals exactly 4 binary bits.
How to use
- 1 Choose a mode: 'Arithmetic' for hex math, or 'Base Converter' to convert between number bases.
- 2 In Arithmetic mode, enter two hex values and select an operation (Add, Subtract, Multiply, or Divide).
- 3 In Base Converter mode, enter a number and select its source base. All four bases are shown simultaneously.
- 4 Hex digits A–F are accepted in both upper and lower case.
Formula
Example calculation
1A + 2F = 49 (hex) = 73 (decimal). FF × 2 = 1FE (hex) = 510 (decimal). Decimal 255 = FF (hex) = 11111111 (binary) = 377 (octal).
Frequently asked questions
What is hexadecimal?
Hexadecimal is a base-16 number system using digits 0–9 and letters A–F. It's widely used in computing because it provides a human-readable shorthand for binary values — each hex digit represents exactly 4 binary bits.
How do you add hex numbers?
Add each column right to left. If the sum is 10–15, write the corresponding hex letter (A–F). If the sum is 16 or more, write the remainder (in hex) and carry 1 to the next column.
What does 0xFF mean in programming?
0xFF is how hexadecimal literals are written in most programming languages (C, JavaScript, Python, etc.). FF in hex equals 255 in decimal, often used to represent a full byte or an opaque alpha channel in colors.
How is hex related to binary?
Each hexadecimal digit maps exactly to a 4-bit binary group. For example, hex F = binary 1111 and hex A = binary 1010. This makes converting between them very straightforward.
What is octal and when is it used?
Octal is base-8 (digits 0–7). It was used in early computing and is still used in Unix/Linux file permissions (e.g., chmod 755), where each digit represents 3 binary bits.