Advanced calculator for hexadecimal arithmetic, bitwise operations, and number system conversions. Essential tool for programmers and digital system designers.
Hexadecimal Arithmetic: Perform addition, subtraction, multiplication, and division with hexadecimal numbers.
Hexadecimal is a base-16 number system that uses sixteen distinct symbols: 0-9 to represent values zero to nine, and A-F (or a-f) to represent values ten to fifteen. Hexadecimal is widely used in computing and digital systems.
Hexadecimal Place Values:
In hexadecimal, each position represents a power of 16:
... 16³ 16² 16¹ 16⁰ . 16⁻¹ 16⁻² ...
So the hexadecimal number 1A3 represents: (1×16²) + (10×16¹) + (3×16⁰) = 256 + 160 + 3 = 419 (decimal)
| Hex Addition | Decimal Equivalent | Result |
|---|---|---|
| 5 + 7 | 5 + 7 | C (12) |
| 9 + 8 | 9 + 8 | 11 (17) |
| A + 6 | 10 + 6 | 10 (16) |
| F + 1 | 15 + 1 | 10 (16) |
| FF + 1 | 255 + 1 | 100 (256) |
Compact Representation: One hex digit represents exactly 4 binary digits (bits), making it more compact than binary for human readability.
11111111 (binary) = FF (hex)
Memory Addressing: Computer memory addresses are often expressed in hexadecimal. A 32-bit address like 0x00400000 is easier to read than its binary equivalent.
Color Codes: Web colors use hexadecimal notation (e.g., #FF0000 for red, #00FF00 for green, #0000FF for blue).
Debugging and Disassembly: Machine code and memory dumps are typically displayed in hexadecimal for easier analysis.
Network Protocols: MAC addresses, IPv6 addresses, and many protocol fields use hexadecimal notation.
64-bit Operations: This calculator uses JavaScript BigInt for accurate 64-bit calculations. BigInt allows representation of integers beyond the 53-bit limit of regular JavaScript numbers.
Negative Numbers: Negative hexadecimal numbers are handled using two's complement representation. For 64-bit negative numbers, the calculator displays the full 64-bit two's complement form.
Examples:
| Decimal | Hexadecimal | Binary | Significance |
|---|---|---|---|
| 0 | 0x00 | 00000000 | Null/Zero value |
| 255 | 0xFF | 11111111 | Maximum 8-bit value |
| 65535 | 0xFFFF | 1111111111111111 | Maximum 16-bit value |
| 16777215 | 0xFFFFFF | 111111111111111111111111 | Maximum 24-bit value (True color) |
| 4294967295 | 0xFFFFFFFF | 11111111111111111111111111111111 | Maximum 32-bit value |
| 18446744073709551615 | 0xFFFFFFFFFFFFFFFF | 64 ones | Maximum 64-bit value |
| 128 | 0x80 | 10000000 | MSB set in 8-bit |
| 10 | 0x0A | 00001010 | Line feed (LF) character |
| 13 | 0x0D | 00001101 | Carriage return (CR) character |
Each hexadecimal digit corresponds to exactly 4 binary digits (bits):
Conversion Table:
| Hex | Binary |
|---|---|
| 0 | 0000 |
| 1 | 0001 |
| 2 | 0010 |
| 3 | 0011 |
| 4 | 0100 |
| 5 | 0101 |
| 6 | 0110 |
| 7 | 0111 |
| Hex | Binary |
|---|---|
| 8 | 1000 |
| 9 | 1001 |
| A | 1010 |
| B | 1011 |
| C | 1100 |
| D | 1101 |
| E | 1110 |
| F | 1111 |
Example: 0x2F = 0010 1111 = 00101111 in binary
Calculator Features:
0x prefix is a notation convention used in many programming languages (C, C++, Java, JavaScript, etc.) to indicate that a number is hexadecimal. Without the prefix, hex digits might be confused with variable names or other symbols. In this calculator, you can use either format: FF or 0xFF are both valid.
A + 7
= 11
FF - A
= F5
10 × B
= B0
A5 & 3C
= 24
F0 | 0F
= FF
FF ^ AA
= 55