Programmer Calculator
Type a number in hex, decimal, octal or binary and see it in all four at once. Flip bits, pick a word size, and run bitwise operations with exact 64-bit math.
ASCII: only for values 0–127
The input base controls how you type numbers A and B. Switching it rewrites both numbers in the new base without changing their value. The hex, octal and binary rows always show the raw bit pattern of the word, while the decimal row shows the value as signed or unsigned depending on the mode.
The word size sets how many bits a value has. Anything that doesn't fit is wrapped the way a real processor would, and the calculator warns you when that happens. Division is integer division that rounds toward zero, and the remainder takes the sign of A, matching C, Java and JavaScript.
Shifts and rotates use B as the number of places. Shifting left by one doubles the value; rotating moves the bits that fall off one end back in at the other, so no information is lost.
Why is -1 shown as FF or FFFFFFFF?
Signed numbers are stored in two's complement. In 8 bits, -1 is every bit set, which reads as FF in hex and 11111111 in binary. The decimal row shows -1 in signed mode and 255 in unsigned mode because it's the same bit pattern read two ways.
What does overflow mean here?
Each word size can only hold a fixed range: 8-bit signed holds -128 to 127, 8-bit unsigned holds 0 to 255. When the true answer falls outside that range, the extra bits are dropped and the value wraps around, exactly like it would in C, Java, or a CPU register. The calculator tells you whenever that happens.
What's the difference between a logical and an arithmetic right shift?
A logical shift fills the new high bits with 0, so it treats the value as unsigned. An arithmetic shift copies the sign bit into the new high bits, so a negative number stays negative (-16 >> 2 = -4). For positive numbers they give the same answer.
Is 64-bit math exact?
Yes. Everything is computed with arbitrary-precision integers and then wrapped to the chosen word size, so 64-bit values like 18446744073709551615 are exact rather than rounded the way ordinary JavaScript numbers would be.



