Bitwise Tools

Bitwise Calculator

Apply AND, OR, XOR, NAND, NOR, or XNOR to two unsigned integers at a fixed width of 8, 16, 32, or 64 bits.

✓ Private · no uploads

Bitwise Calculator
View options
Keyboard shortcuts

Ctrl/⌘ + Enter: process

Ctrl/⌘ + Shift + F: full screen

Esc: exit full screen

Ctrl/⌘ + F in editor: search

Bitwise result
Your result will appear here

When it is ready, copy or download the result.

ReadyAutomatic
Lines: 1 · Characters: 0 · Size: 0 B · Time: — · Cursor: 1:1

How to use

  1. Enter the first operand in decimal or with a 0x, 0b, or 0o prefix.
  2. Choose an operation, enter the second operand, and select a bit width.
  3. Run the calculation and compare decimal, hexadecimal, and padded binary output.
  4. Change the width when checking a different register or mask.

Examples

Inspect an XOR mask

Set the second operand to 0x0f, select XOR, and keep the default 8-bit width. XOR sets a result bit when the corresponding input bits differ.

Input
0x5a
Output
Decimal: 85
Hex: 0x55
Binary: 01010101

Work with fixed-width masks

Bitwise calculations are useful when checking permission flags, register values, and protocol fields. Enter two operands and choose how the corresponding bits combine. AND keeps bits present in both values; OR keeps bits present in either; XOR keeps bits that differ. NAND, NOR, and XNOR invert those results within the selected width. Fixed width matters because an unbounded complement would have no natural leading edge.

This calculator uses exact big-integer arithmetic, including at 64 bits. The output shows the same value in three representations: decimal for a numeric check, hexadecimal for compact byte-oriented reading, and binary with zero padding to the chosen width. A value outside that width is rejected rather than silently truncated. If you need to translate one number between bases without an operation, use the Number Base Converter. All input stays in your browser.

A common debugging pattern is to write the operands in hexadecimal, then read the padded binary result to see exactly which positions changed. The width selection also determines the mask used by NAND, NOR, and XNOR. Record that width when sharing a result.

The default settings are XOR and 8 bits. Try the example before changing the width. Leading zeros do not change an operand’s value; the padded output makes the selected width explicit. Enter one unsigned integer in each field, without signs, fractions, or separators. Copy and download preserve the result labels so the bases remain clear.

Frequently asked questions

Are inputs signed?

No. Inputs must be nonnegative and fit within the selected width.

How is NOT limited?

Complement operations are masked to the selected 8, 16, 32, or 64 bits.

Can I enter hexadecimal values?

Yes. Use a 0x prefix; 0b and 0o work for binary and octal.

Why is an operand rejected?

The value may be negative, malformed, or too large for the selected bit width.

Related tools