Bitwise Calculator
Calculate AND, OR, XOR, NOT and shifts on two integers in your browser. Every result is printed in decimal, binary, hex and octal.
What this bitwise calculator does
Each line is two non-negative integers, accepted in decimal, 0x hex, 0b binary or 0o octal. Both operands and all six operations are printed in four bases, and NOT and the shifts use a stated bit width so the result is reproducible rather than dependent on a machine word size.
How to use it
Bitwise Calculator: paste the two integers into the box above, and press Run to get the bitwise result below.
Worked example
Input:
12 10
Output:
a = 12 (0b1100, 0xc, 0o14)
b = 10 (0b1010, 0xa, 0o12)
width = 8 bits (NOT and shifts use this width)
AND 8 (0b1000, 0x8, 0o10)
OR 14 (0b1110, 0xe, 0o16)
XOR 6 (0b110, 0x6, 0o6)
NOT a 243 (0b11110011, 0xf3, 0o363)
a << 1 24 (0b11000, 0x18, 0o30)
a >> 1 6 (0b110, 0x6, 0o6)
Why it runs in your browser
The conversion happens on this page with JavaScript. Your input is not posted to a server, so it works offline after the page loads and nothing is retained anywhere. The page reads two integers and returns bitwise result; reloading the page discards both.
Each line is two non-negative integers, accepted in decimal, 0x hex, 0b binary or 0o octal. Both operands and all six operations are printed in four bases, and NOT and the shifts use a stated bit width so the result is reproducible rather than dependent on a machine word size.
Calculate AND, OR, XOR, NOT and shifts on two integers in your browser. Every result is printed in decimal, binary, hex and octal.
How to use it
Bitwise Calculator: paste the two integers into the box above, and press Run to get the bitwise result below.
Why it runs in your browser
The conversion happens on this page with JavaScript. Your input is not posted to a server, so it works offline after the page loads and nothing is retained anywhere. The page reads two integers and returns bitwise result; reloading the page discards both.
What to Expect
Best for
- Converting two integers to bitwise result when the data is already on screen.
What this tool keeps
- Your input is not posted to a server, so it works offline after the page loads and nothing is retained anywhere.
Sample input
12 10
Sample output
a = 12 (0b1100, 0xc, 0o14) b = 10 (0b1010, 0xa, 0o12) width = 8 bits (NOT and shifts use this width) AND 8 (0b1000, 0x8, 0o10) OR 14 (0b1110, 0xe, 0o16) XOR 6 (0b110, 0x6, 0o6) NOT a 243 (0b11110011, 0xf3, 0o363) a << 1 24 (0b11000, 0x18, 0o30) a >> 1 6 (0b110, 0x6, 0o6)
Frequently asked questions
How do I use the bitwise calculator?
Bitwise Calculator: paste the two integers into the box above, and press Run to get the bitwise result below.
Is my input uploaded?
No. The text is parsed on this page with JavaScript and is never posted to a server.
Is there a size limit?
Yes: 5 MB per run. Larger input is refused with a message rather than freezing the tab.
Build custom tools for your store
Join the SDK program to create useful ecommerce utilities for your store.