Perform a bitwise AND and inspect the result in decimal, binary, and hexadecimal.
Last updated: June 2026 | By Patchworkr Team
Bitwise AND compares two integers one bit at a time. A bit stays 1 only when both input bits are 1.
That makes AND useful for masking, flags, and low-level integer operations.
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.
Bitwise AND keeps only the positions where both numbers have a 1.
Each matching 1 survives the comparison, so the output keeps only the shared bits.
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.
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.
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.
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