Solve binary AND, OR, XOR, NOT, and shifts. View decimal values, masks, complements, and outputs. Export clean results, compare inputs, and study bit patterns.
| Input A | Input B | Width | A AND B | A XOR B | A << 2 |
|---|---|---|---|---|---|
101101 |
011010 |
8 | 00001000 |
00110111 |
10110100 |
11001100 |
00001111 |
8 | 00001100 |
11000011 |
00110000 |
1010 |
0101 |
4 | 0000 |
1111 |
1000 |
AND: A & B keeps bits that are 1 in both values.
OR: A | B keeps bits that are 1 in either value.
XOR: A ^ B keeps bits that are different.
NOT: ~A flips each bit inside the chosen width.
NAND: ~(A & B) with the width mask applied.
NOR: ~(A | B) with the width mask applied.
XNOR: ~(A ^ B) with the width mask applied.
Left shift: A << n moves bits left by n places.
Right shift: A >> n moves bits right by n places.
Mask: (2width - 1) keeps only the selected bits.
Signed value: If the top bit is 1, subtract 2width.
Binary bitwise math works one bit at a time. Each position stores either 0 or 1. That makes patterns easy to miss during manual work. A dedicated calculator speeds up checks and reduces simple mistakes. It also helps learners connect binary logic with decimal outputs.
This page covers AND, OR, XOR, NAND, NOR, XNOR, and NOT. It also handles left shifts and logical right shifts. These operations are common in mathematics, logic design, digital systems, and programming. They support flag tests, masks, toggles, permission checks, and compact data storage.
Bit width controls the active register size. A complement result depends on that width. Without a fixed width, a NOT answer is incomplete. Width also changes signed interpretation through two’s complement rules. This calculator shows unsigned and signed decimals together, so the same bit pattern becomes easier to understand.
When you compare two binary inputs side by side, patterns become clear. Shared 1 bits stand out in AND results. Different bits appear in XOR results. Repeated 1 values can act like masks. Shifted outputs show how values change when positions move left or right. This supports classroom practice and self-study.
Developers often inspect packed values, options, and status flags. Students verify homework with quick comparisons. Engineers review register states and signal masks. Analysts use bitwise logic when checking encoded states. A clean output table makes every transformation easy to review, copy, and export.
Bitwise reasoning also supports math exercises on parity, powers of two, and binary decomposition. You can test alternating patterns, dense masks, and sparse masks in seconds. That makes the tool useful for exam revision. It is also helpful for interview preparation. Many technical questions ask how a mask isolates bits or how XOR toggles a state. By seeing binary, decimal, and hexadecimal values together, you build stronger intuition. The result table becomes a visual proof of each operation. That saves time when explaining answers to teachers, teammates, or clients.
The CSV export is useful for worksheets and reports. The PDF option creates a neat snapshot for sharing. The example data table also gives quick reference cases. Altogether, this binary bitwise operations calculator turns abstract logic into visible and practical math.
It compares matching bit positions. The result bit becomes 1 only when both input bits are 1. All other pairs return 0.
NOT flips every bit inside the chosen width. A four-bit NOT and an eight-bit NOT can produce different answers from the same input.
OR returns 1 when either bit is 1. XOR returns 1 only when the two bits are different. Matching bits produce 0 in XOR.
The same binary pattern can represent two meanings. Unsigned treats all bits as magnitude. Signed uses the top bit as a sign in two’s complement form.
A left shift moves bits to the left. In many cases, it acts like multiplying by powers of two, until masked bits are discarded.
It moves bits to the right and fills the left side with zeros. This is useful for width-limited binary calculations and mask work.
Yes. Any character other than 0 and 1 is removed during cleanup. The calculator then normalizes the value to the chosen bit width.
The calculator keeps only the selected width. Bits that move beyond that width are dropped. This mirrors register-style binary behavior.
Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.