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 (base 16) is a compact, human‑friendly way to represent binary data. Each hex digit corresponds to exactly four binary bits (a nibble), making it the lingua franca of low‑level programming, memory addressing, color codes (#RRGGBB), and network protocols (MAC addresses, IPv6). Unlike decimal, hex aligns naturally with the byte‑oriented architecture of modern computers.
16 n · dn + … + 161 · d1 + 160 · d0
Where d ∈ {0–9, A–F} and n is the position from the right.
Our calculator parses input with support for common prefixes: 0x (hex), 0b (binary), 0o (octal), and plain decimal. It then converts to an internal 64‑bit signed integer, from which all other bases are derived. The bitwise operations (AND, OR, XOR, NOT, shifts) operate on 32‑bit signed integers to mimic the behavior of common programming languages (C, Java, Python). Shifts are arithmetic right shifts (>>) preserving the sign bit, and zero‑fill right shifts (>>>) move zeros from the left.
The two's complement representation is shown for negative numbers, giving you insight into how computers encode signed integers. The IEEE‑754 preview attempts to reinterpret the 32‑bit pattern as a single‑precision floating‑point number — a handy feature when you're dealing with embedded systems or network protocols that pack floats into words.
| Decimal | Hexadecimal | Octal | Binary | Meaning |
|---|---|---|---|---|
| 0 | 0x00 | 0 | 0000 0000 | Zero |
| 255 | 0xFF | 377 | 1111 1111 | Max 8‑bit unsigned |
| 256 | 0x100 | 400 | 1 0000 0000 | First 9‑bit value |
| 1024 | 0x400 | 2000 | 100 0000 0000 | 1 KiB |
| 65535 | 0xFFFF | 177777 | 1111 1111 1111 1111 | Max 16‑bit unsigned |
| -1 (32‑bit) | 0xFFFFFFFF | 37777777777 | 1111 … 1111 | Two's complement |
| 0xDEADBEEF | 0xDEADBEEF | 33653337357 | 1101 1110 … | Magic debug value |
IPv6 addresses are 128‑bit values conventionally written as eight groups of four hex digits, e.g. 2001:0db8:85a3:0000:0000:8a2e:0370:7334. Leading zeros can be omitted, and consecutive zero groups can be compressed with ::. Our Hex Calculator helps network engineers quickly convert between the compressed notation and the full 128‑bit binary representation, making subnet calculations and address planning more transparent. Try entering 0x20010DB885A3000000008A2E03707334 to see the full binary layout.
AND (&): Each bit of the output is 1 only if both corresponding bits are 1.
Used for masking (extracting specific bits).
OR (|): Each bit is 1 if at least one corresponding bit is 1. Used for setting bits.
XOR (^): Each bit is 1 if exactly one corresponding bit is 1. Used for toggling bits.
NOT (~): Inverts every bit (one's complement). In two's complement, ~x = -x - 1.
Left shift (<<): Moves bits to the left, filling with zeros. Equivalent to multiplying by 2n.
Right shift (>>): Moves bits to the right, preserving the sign bit (arithmetic). Equivalent to integer division by 2n.
Zero‑fill right shift (>>>): Moves bits to the right, always filling with zeros. Unsigned shift.