Bitwise Calculator

Bit width
A & B
Decimal
15
Hex
0xf
Binary
0b1111
Octal
0o17
A | B
Decimal
255
Hex
0xff
Binary
0b1111 1111
Octal
0o377
A ^ B
Decimal
240
Hex
0xf0
Binary
0b1111 0000
Octal
0o360
~A
Decimal
4294967040
Hex
0xffffff00
Binary
0b1111 1111 1111 1111 1111 1111 0000 0000
Octal
0o37777777400
~B
Decimal
4294967280
Hex
0xfffffff0
Binary
0b1111 1111 1111 1111 1111 1111 1111 0000
Octal
0o37777777760
A << B
Decimal
8355840
Hex
0x7f8000
Binary
0b0111 1111 1000 0000 0000 0000
Octal
0o37700000
A >> B
Decimal
0
Hex
0x0
Binary
0b0000
Octal
0o0
Calculated locally in your browser with BigInt. Your input stays only on this page.

Compute bitwise AND, OR, XOR, NOT, and shifts

Enter two operands in decimal, 0x hex, 0b binary, or 0o octal, then read off every result in all four bases at once. Use it to build a bitmask, check a flag, OR permission bits together, or reason about a shift without reaching for a REPL.

The bit width (8, 16, 32, or 64) defines the ~ (NOT) result and masks the shift output, so values stay exact up to 64 bits via BigInt. Operands are treated as unsigned — negative input is rejected rather than guessing two’s-complement intent.