Programmer Calculator (bitwise)
AND, OR, XOR, NOT, shifts and rotates on 8/16/32/64-bit numbers. Shows decimal, signed, hex, binary and octal.
Also called: bitwise calculator, hex calculator, programmer calculator online.
Programmer Calculator (bitwise)
AND, OR, XOR, NOT, shifts and rotates on 8/16/32/64-bit numbers. Shows decimal, signed, hex, binary and octal.
Watch: how to use the Programmer Calculator (bitwise) (12 seconds)
Recorded on a phone, steps written on screen, no sound. Open the video page.
About the Programmer Calculator (bitwise)
Run bitwise operations on 8, 16, 32 or 64-bit numbers: AND, OR, XOR, NAND, NOR, NOT, left and right shifts and rotates. Enter values in decimal, or as hex (0x1F) or binary (0b1010).
Every result is shown as unsigned and signed (two's complement) decimal, hexadecimal, binary and octal, so you can check masks, flags and register values without switching modes.
The arithmetic uses BigInt, so 64-bit values are exact, which ordinary JavaScript numbers cannot guarantee above 2^53.
Bitwise calculator examples and signed results
For an 8-bit example, set A to 0xFF and B to 0x0F. A AND B returns 0x0F (15). NOT A flips every bit within the selected width, so NOT 0 in 8-bit mode is 255 unsigned or −1 signed.
Choose the bit width that matches the value or register you are testing. Results are shown in decimal, hexadecimal, binary and octal, with both unsigned and two's-complement signed interpretations. Values that exceed the selected width wrap to that width; the tool flags an overflow where applicable.
A logical right shift fills new high bits with zero, while an arithmetic right shift preserves the sign bit. Use the operation that matches the instruction or programming language you are checking.
How to use the Programmer Calculator (bitwise)
- Add your inputFill in value A and value B. An example is already filled in, so you can press Run tool first to see how it works.
- Pick the optionsoperation and bit width (the defaults suit most uses).
- Press Run toolThe result appears right under the button.
- Copy or download the resultCopy text results with Copy output; when the tool makes a picture or file, use its Download button.
This tool works inside your browser: what you enter stays on your device.
Example
A sample input and the result the Programmer Calculator (bitwise) gives for it (produced by the tool itself, not typed by hand).
- Value A
- 0xFF
- Value B
- 15
- Operation
- A AND B
- Bit width
- 32-bit
Result:
Decimal (unsigned): 15 Decimal (signed): 15 Hex: 0x0000000F Binary: 0000 0000 0000 0000 0000 0000 0000 1111 Octal: 0o17
Good to know
- What you need
- You type or choose: Value A, Value B
- Where it runs
- In your browser, on your device.
- Cost
- Free, no sign-up.
Questions
What is the difference between logical and arithmetic shift?
A logical right shift fills with zeros; an arithmetic shift keeps the sign bit. This tool's >> is logical.
Why does NOT give a large number?
NOT flips every bit within the chosen width, so NOT 0 in 8-bit is 255 unsigned, or −1 signed.
Can I enter hex?
Yes, write it with 0x, for example 0xFF.
More tools in Calculators
- Quadratic Equation Solver
- Running Pace Calculator
- Scientific Calculator
- Sleep Calculator (bedtime & wake-up time)
- Survey Sample Size Calculator
- Unit Converter
- Water Intake Calculator
- Aggregate Calculator (MDCAT, NUST, UET & custom)
- BMI Calculator
- Body Fat Calculator (US Navy method)
- Construction Calculator (bricks, cement, sand, concrete)
- Daily Calorie Needs (BMR & TDEE)