Bitwise Calculator

Enter two integers to compute AND, OR, XOR, NOT, and bit shifts, shown in decimal, binary, and hexadecimal.

Last updated: 2026/10/16 Developer Feedback & bug reports
Options
Input
Value A
Value B
Results
Enter Value A and Value B to see the results here.

How to Use

1

Choose base and bit width

Select the base of your input (decimal/hex/binary/octal) and the bit width (8-64 bit) used for the operations.

2

Enter Value A and Value B

Enter two integers. For shift operations, also specify the shift amount.

3

Review and copy

AND, OR, XOR, NOT and shift results appear automatically in decimal, hex, and as a bit map. Use the copy button to grab any result.

About the Bitwise Calculator

A free online tool that computes bitwise logical operations (AND, OR, XOR, NOT) and bit shifts (left and right) on two integers at once. Input can be given in decimal, hexadecimal, binary, or octal, and results are shown as decimal and hex numbers plus a visual bit map. All math uses BigInt, so large values are calculated exactly without overflow.

Features

  • 7 Bitwise OperationsAND, OR, XOR, NOT A, NOT B, left shift and right shift computed and listed together.
  • Multi-base InputEnter values in decimal, hex, binary, or octal; results in decimal, hex, and binary.
  • Visual Bit MapEach result is shown bit by bit with highlighting so set bits are easy to spot.
  • BigInt, No OverflowPick a bit width from 8 to 64 bit; BigInt math keeps large values exact.

Use Cases

  • Designing and verifying flags and bit masks
  • Building permission (access) bits
  • Network subnet mask calculations
  • Debugging embedded register operations
  • Learning how bitwise operations work

FAQ

Why does the NOT result change with the bit width?
NOT flips every bit. The number of bits flipped depends on the mask, so the result differs between 8-bit and 32-bit. Choose the bit width that matches your actual data type.
Do I need a prefix when entering hex or binary?
No. As long as you select the matching base, you can type values like "FF" or "1010" directly. Prefixes such as 0x, 0b, or 0o are also accepted.
Is the right shift arithmetic or logical?
This tool works with non-negative (unsigned) integers, so the right shift is a logical shift that fills with zeros. Results are masked to the selected bit width.
Can it handle very large numbers correctly?
Yes. It uses JavaScript BigInt internally, so values beyond 64 bits are computed exactly without overflow.
Are the numbers I enter sent to a server?
No. All calculations run entirely in your browser. Your input is never sent to or stored on any server, so you can use it with confidence.