Bitwise Calculator

Live

Bitwise Calculator shows AND, OR, XOR, NAND, NOR, XNOR, NOT, shifts and rotations of two numbers at a chosen bit width.

Runs in your browser: what you enter is processed on your device and not uploaded to MyToolDock.

What is Bitwise Calculator?

Bitwise Calculator shows AND, OR, XOR, NAND, NOR, XNOR, NOT, shifts and rotations of two numbers at a chosen bit width. Values use two’s complement, so -1 is all ones. A number must fit the chosen width. Arithmetic right shift keeps the sign bit and logical right shift fills with zeros.

How It Works

  1. Enter two numbers in decimal, hex (0x), binary (0b) or octal (0o), a bit width and a shift amount in the input fields on this page.
  2. Press the button to run Bitwise Calculator.
  3. Read a table of every result in unsigned, signed, hex and binary in the result area, and copy or download it.

Common Uses

Good to Know

Pick the bit width first. NOT and rotations give different answers at 8, 16, 32 and 64 bits.

How it works

Pick a bit width, enter A and B in decimal, hex (0x), binary (0b) or octal (0o), and set a shift amount. The table shows every operation as unsigned and signed values, hex and binary.

Negative numbers are accepted and shown in two's complement.

Worked example

All thirteen operations were compared with Python integers on 400 random cases at 8, 16, 32 and 64 bits (negatives, boundary values, mixed number bases, shifts from 0 to over twice the width), along with the signed values, hex, binary and bit counts.

Limits

Values must fit the chosen width, from the lowest signed value to the highest unsigned value. Shifts and rotations use the amount you enter; rotations wrap around by that amount modulo the width. Shifts up to 100,000 are accepted.

Frequently Asked Questions

What is the difference between >> and >>>?

>> copies the sign bit into the new left bits, while >>> always fills with zeros.

Why is -1 shown as all ones?

Computers store negative numbers in two's complement, where -1 sets every bit.

Are my numbers uploaded?

No. They are processed in your browser.

What does Bitwise Calculator do?

Bitwise Calculator shows AND, OR, XOR, NAND, NOR, XNOR, NOT, shifts and rotations of two numbers at a chosen bit width. Values use two’s complement, so -1 is all ones. A number must fit the chosen width. Arithmetic right shift keeps the sign bit and logical right shift fills with zeros.

What do I need to enter in Bitwise Calculator?

Two numbers in decimal, hex (0x), binary (0b) or octal (0o), a bit width and a shift amount.

Is my data private in Bitwise Calculator?

Your numbers stay in your browser and are not uploaded.

Is MyToolDock Bitwise Calculator free to use?

Yes, MyToolDock Bitwise Calculator is 100% free with no registration, subscriptions, or limits. All features are fully unlocked.

Related Tools

.env and .properties to JSON Converter .env File Validator Ascii85 Encoder and Decoder Base32 Encoder and Decoder Basic Auth Header Generator CORS Header Generator

More Developer Tools guides

More in Developer Tools · Browse all tools

Developer Scratchpad

Copied to clipboard!