Hexadecimal Calculator
Handles arbitrary-precision arithmetic (BigInt)
Hex Calculator – Guide & Info
What is Hexadecimal?
Hexadecimal (base-16) uses digits 0-9 and letters A-F. It's commonly used in computing for memory addresses, colors, and low-level programming.
Addition & Subtraction
Hex addition/subtraction works like decimal arithmetic. Convert hex to decimal, perform the operation, then convert back to hex.
Multiplication & Division
For multiplication, treat hex as decimal numbers, multiply, then convert back. For division, integer division is used; the remainder can be displayed.
Negative Hex Values
Negative numbers are shown with a '-' sign for simplicity. In computing, two's complement is often used for negative hex representation.
Conversion Tips
Convert hex to decimal using `parseInt(hex, 16)` in JavaScript. Convert decimal to hex using `num.toString(16).toUpperCase()`.
Real-World Use
Hexadecimal is used in color codes (e.g., #FF00AA), memory addresses, debugging, networking (MAC addresses), and assembly programming.
Example Calculations
Example 1: Addition
- Hex 1 = A5
- Hex 2 = 2F
- A5 + 2F = D4 (hex) = 212 (decimal)
Example 2: Subtraction
- Hex 1 = FF
- Hex 2 = 1A
- FF − 1A = E5 (hex) = 229 (decimal)
Example 3: Multiplication
- Hex 1 = 10
- Hex 2 = 5
- 10 × 5 = 50 (hex) = 80 (decimal)
Example 4: Division
- Hex 1 = A0
- Hex 2 = 3
- A0 ÷ 3 = 34 (hex) remainder 2 = 52 remainder 2 (decimal)
Share
Hex Calculator Online | Solvezi