Intermediate

Bitwise Calculator — AND, OR, XOR, NOT, NAND, NOR, XNOR

Apply any bitwise logic operation — AND, OR, XOR, NAND, NOR, XNOR or NOT — to two integers within a selectable bit width, and see the result in decimal, binary and hex with a step-by-step bit column view.
Non-negative integer within the chosen bit width
Required for AND, OR, XOR, NAND, NOR, XNOR

Πράξη

Bit width

Result (decimal)
12
Result (binary)
00001100
Result (hex)
0xC
A (binary)
00111100
B (binary)
00001101
Bit-by-bit working
1

A

00111100 (60)
2

B

00001101 (13)
3

&

────────
=

Result

00001100 (12)
0326496128160192224256A, B and result on the 8-bit number line
Τα αποτελέσματα είναι εκτιμήσεις μόνο για γενική ενημέρωση και δεν αποτελούν επαγγελματική συμβουλή — επαληθεύετε πάντα τα σημαντικά αποτελέσματα ανεξάρτητα προτού βασιστείτε σε αυτά. Διαβάστε την πλήρη αποποίηση ευθύνης.
Γρήγορη απάντηση

Πώς λειτουργεί αυτή η αριθμομηχανή;

Bitwise operations act on each bit pair independently. AND: 1 & 1 = 1, else 0; OR: 0 | 0 = 0, else 1; XOR: equal bits → 0, different → 1. NOT flips all bits within the register width. NAND/NOR/XNOR invert AND/OR/XOR. All results are masked to the chosen bit width (4/8/16/32/64).

Τύπος
AND: each bit 1 only if both bits are 1 • OR: 1 if either bit is 1 • XOR: 1 if bits differ • NOT: flip all bits within the mask • NAND/NOR/XNOR: inverted AND/OR/XOR
How this is calculated

Bitwise operators work independently on each corresponding pair of bits in two operands, making them extremely fast on modern CPUs (single-cycle instructions). The six standard operations are: AND (result bit 1 only when both input bits are 1 — used to extract or test bit fields), OR (result bit 1 when either input bit is 1 — used to set bits), XOR (exclusive OR: result bit 1 when bits differ — used to toggle bits or compute parity), and their negated counterparts NAND, NOR and XNOR. NOT is unary — it flips all bits within the specified register width.

All calculations are performed with JavaScript BigInt for exact integer arithmetic at any bit width up to 64. The operands are masked to the chosen width before the operation, so a value of 60 in an 8-bit context is treated as 0011 1100. The result is also masked, ensuring it fits within the register. This mirrors the behaviour of fixed-width unsigned integer types in C, Rust and most systems languages.

The bit-by-bit working panel aligns the binary representations of A, B, and the result column by column so you can verify each output bit against the truth table mentally. This is the most direct way to understand what the operation is doing at the hardware level.

Συχνές ερωτήσεις

XOR is used for bit toggling, in-place variable swapping (a ^= b; b ^= a; a ^= b), parity computation, simple encryption/masking, and in hash functions. A key property is that A ^ A = 0 and A ^ 0 = A, making XOR a self-inverting operation.

NOT flips every bit within the chosen register width. In an 8-bit register, NOT 0 = 1111 1111 = 255. In a 16-bit register, NOT 0 = 65 535. The result depends on the bit width you select, which is why you should always match the width to your target data type.

To test or extract specific bits, AND the value with a bitmask that has 1s in the positions you care about and 0s elsewhere. For example, to isolate the lower 4 bits of a byte, AND with 0x0F (0000 1111). The result clears all upper bits while preserving the lower nibble.

Γνωστό και ως

bitwise and or xor calculator
bitwise not nand nor xnor
bit manipulation calculator
boolean logic bitwise operations
binary bitwise calculator
bitwise operations explained
logic gate bit calculator

APA

TG we-Calculate Editorial Team. (2026). Bitwise Calculator — AND, OR, XOR, NOT, NAND, NOR, XNOR [Online calculator]. TG we-Calculate. https://we-calculate.com/el/calculator/bitwise-calculator

Chicago

TG we-Calculate Editorial Team. "Bitwise Calculator — AND, OR, XOR, NOT, NAND, NOR, XNOR." TG we-Calculate. 2026. https://we-calculate.com/el/calculator/bitwise-calculator.

IEEE

TG we-Calculate Editorial Team, "Bitwise Calculator — AND, OR, XOR, NOT, NAND, NOR, XNOR," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/el/calculator/bitwise-calculator

BibTeX

@misc{wecalculate_bitwise_calculator, title = {Bitwise Calculator — AND, OR, XOR, NOT, NAND, NOR, XNOR}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/el/calculator/bitwise-calculator}}, year = {2026}, note = {TG we-Calculate} }

Σας βοήθησε αυτή η αριθμομηχανή;

Σχετικές αριθμομηχανές