Bitwise Calculator
Run any bitwise operation on two integers at the width you choose. Enter values in decimal, hex, octal or binary and read the result in every base at once.
How to use the bitwise calculator
- Pick a bit width: 8, 16, 32 or 64 bits.
- Enter the operands in decimal, or with a 0x, 0o or 0b prefix.
- Choose an operation such as AND, XOR or left shift.
- Read the result in binary, hex, octal and decimal.
Examples
AND two bytes
0xF0 AND 0x0F, 8 bits
0x00, binary 0000 0000
Left shift
1 << 4, 8 bits
0x10, binary 0001 0000, decimal 16
Frequently asked questions
Which bitwise operations are supported?
AND, OR, XOR, NOT, NAND, NOR and XNOR, plus logical left and right shifts. NOT and the shifts use a single operand and a shift amount.
What number formats can I enter?
Decimal by default, or use a 0x prefix for hex, 0o for octal and 0b for binary. Underscores and spaces are allowed as digit separators.
Does it support 64-bit values?
Yes. Calculations run on BigInt, so 8, 16, 32 and 64 bit widths are all exact, including the full unsigned 64-bit range.
How are negative numbers handled?
Enter a negative decimal and it is wrapped into the width using twos complement, so -1 at 8 bits becomes 11111111. Results show both the unsigned and signed value.
Is the right shift arithmetic or logical?
Logical. Operands are treated as unsigned within the chosen width, so a right shift always fills the top bits with zeros.
Is my data sent anywhere?
No. Everything runs in your browser, so the values you enter never leave your device.
Related tools
Twos Complement Calculator
Convert a signed integer to its twos complement binary and hex for any bit width. Also decodes a twos complement bit pattern back to a signed value.
Number Base Converter
Convert numbers between any base from 2 to 36, including binary, octal, decimal and hex. Handles huge numbers exactly with arbitrary precision. Free, private.
Chmod Calculator
Convert Unix file permissions between octal (755), symbolic (rwxr-xr-x) and a checkbox grid. Get the chmod command instantly, all in your browser.
.env to JSON
Convert a .env file to JSON, or JSON back to .env. Parses KEY=value lines, comments, quotes and export. Runs entirely in your browser.
ASCII Table
Full ASCII table for all 128 codes with decimal, hex, octal and binary values, character names and descriptions. Search by code, hex or character.
Aspect Ratio Box Generator
Generate CSS for a responsive aspect-ratio container. Use the modern aspect-ratio property or the padding-top fallback, then copy the ready code.