Programmer Calculator
A free programmer calculator: switch between binary, octal, decimal and hex, and apply bitwise AND, OR, XOR, shifts and rotations.
How to use Programmer Calculator
Programmer Calculator works with integers in four bases at once — binary, octal, decimal and hexadecimal. The current base is shown on the display, and the HEX, DEC, OCT and BIN rows below always show the same value in every base, so you can read it in whichever form your code needs.
Pick a base with the 8, 10 or 16 tab above the keypad. The number keys change to match: hex adds A–F, octal keeps 0–7, decimal keeps 0–9.
Type a number on the keypad — it is interpreted in the selected base. The four rows below update live so you can see the same value as hex, decimal, octal and binary.
Apply a bitwise operation from the left column. For a two-input op (AND, OR, XOR, NOR, shift by Y, mod), enter the first number, press the key, enter the second, then press =. For a one-input op (NOT, NEG, rotate, flip8, flip16, shift by 1), press the key and the result appears at once.
Press AC to clear, ⌫ to delete the last digit, or switch bases any time — the value is preserved and re-displayed in the new base. (In hex mode C is the digit C, not a clear key.)
Worked example. Stay in decimal, type 255, then switch to the 16 tab: the display reads FF and the HEX row shows FF, DEC shows 255, OCT shows 377 and BIN shows 11111111. Type 5, press AND, type 3, press = and the result is 1 (binary 0101 AND 0011 = 0001).
Tips for accurate results.
All values are 64-bit signed integers in two's complement, the same width as
int64_tor a Javalong. The DEC row shows the signed value, so NOT 0 reads −1, while the HEX, OCT and BIN rows show the raw bit pattern (FFFFFFFFFFFFFFFF).Shifts << and >> move one bit; X<<Y and X>>Y shift by the second number you enter. >> is a logical shift — it feeds in zeros rather than copying the sign bit.
flip8 and flip16 invert the low 8 or 16 bits, useful when inspecting bytes within a word.
When you actually reach for this
- You want bitwise and base math (hex, binary, octal) for coding.
- You are inspecting or masking integer values.
Where this tool stops being accurate
- It works on integers within a word size (often 32 or 64 bits); values outside wrap around by two's complement.
- It is not for floating-point or decimal money math, which belong in other tools.
Frequently asked questions
What bases does it support?
Binary (base 2), octal (base 8), decimal (base 10) and hexadecimal (base 16). The HEX, DEC, OCT and BIN rows always show the current value in all four bases at once.
Which bitwise operations are available?
Two-input: AND, OR, XOR, NOR, shift left/right by a value (X«Y / X»Y) and modulo. One-input: NOT, two's-complement negate (NEG), rotate left/right (RoL / RoR), and flip the low 8 or 16 bits (flip8 / flip16).
How are numbers represented?
Values are 64-bit signed integers in two's complement, matching int64_t in C or long in Java. The DEC row prints the signed value (so NOT 0 is −1), while HEX, OCT and BIN print the raw bit pattern, and the bit grid shows all 64 bits. Shifts are logical: >> feeds in zeros instead of copying the sign bit.
Is my data sent to a server?
No. Programmer Calculator performs every operation locally. Nothing you type is transmitted, stored, or shared.
Why did my big number flip negative?
It overflowed the word size and wrapped via two's complement, a normal integer behavior at the limit.
What is two's complement?
The standard way computers represent signed integers, so the top bit signals negative and overflow wraps around.