Solve AND bitwise operations with binary clarity. Convert bases, inspect masks, and understand each output using clean steps and helpful examples.
| Number A | Number B | Base | Bit Width | AND Result | Binary Result |
|---|---|---|---|---|---|
| 29 | 23 | Decimal | 8 | 21 | 0001 0101 |
| 11010110 | 10101100 | Binary | 8 | 132 | 1000 0100 |
| 7F | 3A | Hex | 8 | 58 | 0011 1010 |
Bitwise AND compares matching bit positions in two integers.
For each bit position, the result is 1 only when both input bits are 1.
Otherwise, the result bit becomes 0.
Main rule: Result = A & B
Bit rule: 1 AND 1 = 1, 1 AND 0 = 0, 0 AND 1 = 0, 0 AND 0 = 0
When bit width is selected, values are masked to that width first.
Width mask: Mask = 2^n - 1
Prepared value: Valueprepared = Value & Mask
Shifted input: Shifted = (Prepared Value << shift)
Final AND: AND Result = Shifted A & Shifted B
Bitwise AND is a core operation in mathematics and computing. It works at the binary level. Every value becomes a row of bits. The operator checks each pair of bits. It returns 1 only when both positions hold 1. This simple rule makes the operation precise and fast.
This calculator helps with masks, parity checks, and structured binary analysis. Students use it to learn binary logic. Developers use it to isolate flags. Engineers use it to clear or keep selected bit positions. In discrete maths, it supports truth tables and binary reasoning.
This version supports binary, octal, decimal, and hexadecimal inputs. You can also choose bit width. That is useful because many operations depend on 8-bit, 16-bit, or 32-bit boundaries. Signed and unsigned interpretation adds more insight. Optional left shifts let you test preprocessed values before the final AND step.
The main output is the AND result. It also appears in binary, octal, and hex. The grouped binary view is useful for visual checking. Set bit count shows how many ones remain. Leading zeros and trailing zeros help with binary structure analysis. Extra comparison values such as OR, XOR, and NAND add context.
Masking limits values to a fixed width. That keeps the result consistent. Without masking, large integers may show extra bits that do not belong to the chosen width. A mask keeps only the lowest n bits. This reflects common binary practice in maths exercises and digital systems.
Enter small values first. Compare the decimal output with the binary rows. When both rows contain 1 in the same position, the result keeps that 1. All other positions become 0. This visual method makes manual checking easy and reliable for learning and verification.
It compares two integers bit by bit. The result keeps 1 only where both input bits are 1. Every other position becomes 0.
Bit width controls masking and output format. It helps you match classroom problems, digital logic tasks, and fixed-width binary systems.
Yes. You can enter binary, octal, decimal, or hexadecimal values. Choose the correct base for each input before calculating.
Unsigned mode treats all bits as magnitude. Signed mode reads the highest bit as a sign bit using two's complement interpretation.
Shifts let you preprocess the numbers before applying AND. This is useful for testing masks, bit windows, and binary movement.
Leading zeros show unused high positions. Trailing zeros show how many zero bits appear at the end. Both help binary pattern analysis.
These extra results give comparison context. They help you study related logic operations without leaving the same worked example.
Yes. Use the CSV button for spreadsheet-friendly output. Use the PDF button to save or print the visible result section.
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.