A binary, octal and hex calculator is the programmer's everyday tool: it converts a value between bases and performs bit-level logic. Ours lives in BASE-N mode and handles all four bases plus the core bitwise operators.
On this page
The four bases
| Base | Name | Digits |
|---|---|---|
| 2 | Binary (BIN) | 0–1 |
| 8 | Octal (OCT) | 0–7 |
| 10 | Decimal (DEC) | 0–9 |
| 16 | Hexadecimal (HEX) | 0–9, A–F |
Converting between bases
Switch to BASE-N mode, choose the base you're entering, and type the number. Pick a different base to re-display the same value there.
Decimal 255 = 11111111 (binary) = 377 (octal) = FF (hex).
Decimal 13 = 1101 (binary) = D (hex).
The manual method behind this is in the decimal to binary conversion guide.
Bitwise operations
From the logical-operations menu you get AND, OR, XOR, XNOR and NOT. They act bit by bit.
12 AND 10 = 1000 = 8
12 OR 10 = 1110 = 14
12 XOR 10 = 0110 = 6
What each operator does, with truth tables, is in bitwise AND/OR/XOR explained.
Negatives & two's complement
Computers store negative integers using two's complement, and BASE-N arithmetic follows the same rule. For instance, in 8-bit, −5 is 11111011.
The full method — invert and add one — is in the two's complement walkthrough.
Frequently asked questions
How do I convert between bases?
In BASE-N mode, enter the number in one base and switch the displayed base to read its equivalent.
Which bitwise operations are supported?
AND, OR, XOR, XNOR and NOT, bit by bit, from the logical-operations menu.
Does it handle hex A–F?
Yes — in HEX base, A–F represent 10–15, so FF and 1A work directly.
Convert & compute in any base
Open BASE-N mode and switch between binary, octal, decimal and hex instantly.
Open the binary & hex calculator →