And Calculator

Bitwise AND Calculator

Perform a bitwise AND and inspect the result in decimal, binary, and hexadecimal.

Last updated: June 2026 | By Patchworkr Team

Bitwise AND Calculator
Bitwise AND keeps a bit only when both input bits are 1.
Result
8
00001000
0x8

Binary Representation

Number 1: 00001100
Number 2: 00001010
AND Result: 00001000

Bit Table

0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
0
0
0
1
0
0
0
0

What Bitwise AND Means

Bitwise AND compares two integers one bit at a time. A bit stays 1 only when both input bits are 1.

1 AND 1 = 1
1 AND 0 = 0
0 AND 1 = 0
0 AND 0 = 0

That makes AND useful for masking, flags, and low-level integer operations.

Binary, Decimal, and Hexadecimal

The same number can be written in different bases. Decimal is the everyday number system, binary uses only 0 and 1, and hexadecimal is a compact base-16 form.

The calculator converts the values for you so you can focus on the bitwise operation instead of the notation.

How Bitwise AND Works

Bitwise AND keeps only the positions where both numbers have a 1.

12 = 1100
10 = 1010
12 & 10 = 1000 = 8

Each matching 1 survives the comparison, so the output keeps only the shared bits.

Negative Numbers and 32-bit Values

Negative inputs are handled using 32-bit two's complement logic.

That is why the binary display can include a long string of leading 1s for negative numbers, even though the decimal value is still familiar.

The binary preview helps you see the bit-level pattern that the AND operation is working with.

Bit Masks and Flags

A bit mask is a binary pattern used to keep some bits and clear others. Bitwise AND is commonly used for this purpose, because it only preserves positions where both bits are 1.

Programs also store multiple on/off settings inside a single integer. In that case, AND can test whether a specific flag is enabled without changing the rest of the value.

Reading the Bit Table

The bit table shows each bit from the first number, the second number, and the AND result in matching positions.

A result bit of 1 means both input bits were 1. A result bit of 0 means at least one input bit was 0.

This is the most direct way to check why the final result is what it is.

Frequently Asked Questions

Can I use negative numbers?

Yes. Negative values are handled using 32-bit two's complement logic.

Why does binary show leading zeros?

It makes the bitwise comparison easier to read.

Does hexadecimal input work?

Yes. Use the Hex mode and enter values like C or A.

What does 1 mean in the result?

A 1 means both input bits were 1 at that position.

Related Tools