Hex Calculator
Do arithmetic and bitwise operations directly in hexadecimal, with every result shown in hex, decimal, binary and octal at the same time.
How to use it
- Type hexadecimal values using 0-9 and A-F. A leading 0x is accepted and ignored.
- Pick an arithmetic or bitwise operation — AND, OR, XOR and the shifts are all available.
- Every result is shown in all four bases at once.
Examples
| 1A + 2F | 49 |
| FF AND 0F | F |
| 1 << 8 | 100 |
Hexadecimal (base 16) uses digits 0–9 and A–F, where each digit represents exactly 4 bits — which is why hex is the standard shorthand for binary in programming: two hex digits map cleanly onto one byte. This tool does arithmetic and bitwise operations directly in hex and shows every result simultaneously in decimal, binary and octal.
Worked example — arithmetic
1A + 2F in hex: converting to decimal, 1A = 26 and 2F = 47, so 26 + 47 = 73, which is 49 in hex. The tool does this conversion invisibly and shows the hex answer directly, alongside decimal 73, binary 1001001 and octal 111.
Bitwise operations
| Operation | Example | Result |
|---|---|---|
| AND | FF AND 0F | 0F — keeps only bits set in both |
| OR | F0 OR 0F | FF — sets bits present in either |
| XOR | FF XOR 0F | F0 — sets bits that differ |
| Left shift | 1 << 8 | 100 — multiplies by 2⁸ |
Why programmers use hex instead of binary or decimal
Binary is accurate but unreadable at any length — a 32-bit value is 32 characters long. Decimal hides the underlying bit pattern, which matters for masks, flags and memory addresses. Hex is the compromise: compact (8 characters for the same 32-bit value) while every digit maps to exactly 4 bits, so converting to binary in your head is mechanical rather than requiring division.
Questions people ask
Why does division give a whole number?
It truncates toward zero, matching integer division in C, Java and most other languages. For an exact decimal answer, use the division calculator.
How do the shift operators work?
Shifting left by n multiplies by 2ⁿ; shifting right divides by 2ⁿ and discards the remainder. Both operate on the 32-bit value.
Is anything sent to a server?
No. Every calculation runs in your browser, so nothing you type is uploaded and the page keeps working offline once it has loaded.
Also searched for
People find this page looking for hex converter, hexadecimal converter, convert into hex.
Last updated 22 August 2026