Bitwise AND Calculator
Calculate A & B online and see exactly which bit positions stay active when both input bits are 1.
46 Bin00101110 Hex0x2E 74 Bin01001010 Hex0x4A AND Result
Bit-by-Bit Visualization
AND Truth Table
Click a row to load values into A and B, or inspect how each gate behaves.
| Input A | Input B | AND |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
How the Bitwise AND Calculator Works
A bitwise AND calculator compares two integers bit by bit. The result keeps a 1 only where both inputs contain 1, which makes AND useful for masks, permissions, and field extraction.
AND Rule
The output bit is 1 only when the matching bit in A and B is also 1.
Clearing Bits
Any input column containing a 0 returns 0, so AND is commonly used to clear unwanted bits.
Mask Checks
Use AND to isolate a flag, permission bit, protocol field, or packed integer segment.
Aligned Binary
The calculator aligns both binary values so every column can be compared directly.
Bitwise AND Calculation Steps
Follow these steps to calculate a bitwise AND result manually.
Align the Inputs
- Convert both values to binary.
- Pad the shorter value with leading zeros.
- Place matching bit positions in the same column.
Compare Each Column
- Write 1 if both input bits are 1.
- Write 0 if either input bit is 0.
- Keep the selected bit width when displaying the answer.
Use the Mask Result
- Read the result as binary.
- Convert it to decimal or hexadecimal.
- Apply it to isolate or test specific flags.
Bitwise AND Examples
AND examples show how masks keep only the shared active bits.
| Input | Operation | Result | Use |
|---|---|---|---|
101110 & 1001010 | AND | 001010 | Shared active bits only |
11110000 & 00111100 | AND | 00110000 | Nibble mask |
0x2E & 0x4A | AND | 0x0A | Hex mask result |
46 & 74 | AND | 10 | Decimal integer result |
Why Use This Bitwise AND Calculator?
Use this AND calculator when you need a quick mask result with visible bit alignment.
Binary Input Support
Enter values as binary strings and inspect how each bit contributes to the final answer.
Decimal and Hex Views
Compare the same result in decimal, binary, and hexadecimal without switching tools.
Visual Bit Diagram
Use the bit grid to see active bits, included zeros, leading zeros, and changed positions.
Configurable Width
Choose auto, 8-bit, 16-bit, 32-bit, or 64-bit output for programming-style results.
Practical Uses for Bitwise AND
AND is one of the most common bitwise operations in systems programming.
Masks and Flags
Build masks for permissions, settings, protocol fields, and low-level feature toggles.
Low-Level Debugging
Check bit patterns while reviewing firmware, embedded registers, or systems code.
Networking
Inspect headers, subnet masks, and packed fields that depend on bit-level operations.
Packed Values
Read color channels, compact identifiers, and integer fields stored inside one word.
Frequently Asked Questions
Find answers to common questions about bitwise operations and this online tool.