Bitwise AND Calculator

Calculate A & B online and see exactly which bit positions stay active when both input bits are 1.

Number A
Dec46 Bin00101110 Hex0x2E
Number B
Dec74 Bin01001010 Hex0x4A

AND Result

AND (&)
Dec0
Hex0x00
Bin00000000

Bit-by-Bit Visualization

1 Active bit 0 Diff bit 0 Included zero 0 Leading zero

AND Truth Table

Click a row to load values into A and B, or inspect how each gate behaves.

Input AInput BAND
000
010
100
111
Click a truth table row to test those values.

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.

InputOperationResultUse
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.

What is a bitwise AND calculator?
A bitwise AND calculator is an online tool that calculates AND results and shows the answer in binary, decimal, and hexadecimal formats.
Can I use binary input in this bitwise AND calculator?
Yes. Select Binary for Number A or Number B, enter a bit string, and the calculator converts the same value into decimal and hexadecimal.
Why do leading zeros appear in the result?
Leading zeros show the selected bit width. Included zeros inside the active value are highlighted differently so they are not confused with padding.