Integer AND Calculator

Computes the bitwise AND of a list of 2 or more non-negative integers, folding left to right at a 32-bit width, and returns the single combined result. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-27

Overview

Introduction

This tool computes the bitwise AND across a whole list of non-negative integers, folding them together left to right into one result.

It's useful whenever you need to combine flag values or masks using the AND operation without doing the binary math by hand.

What Is Integer AND Calculator?

A calculator that treats bitwise AND as an associative fold across a list: AND the first two values, then AND that with the next, and so on.

It operates at a fixed 32-bit width, matching how bitwise operators behave in most programming languages.

How Integer AND Calculator Works

Each non-blank line is parsed as a non-negative integer no larger than 4,294,967,295 (the maximum unsigned 32-bit value).

The values are combined pairwise with bitwise AND, carrying the running result forward across the whole list.

The final combined result is returned as a single decimal number.

When To Use Integer AND Calculator

Use it to combine several bitmask or flag values together to see which bits remain set in all of them.

It's also useful for teaching or verifying how bitwise AND behaves across more than two operands.

Features

Advantages

  • Handles any number of operands (2 or more) in a single pass, not just two at a time.
  • Uses a clear, fixed 32-bit width so results are predictable and match common programming-language behavior.
  • Clearly rejects negative or oversized inputs instead of silently producing a wrong result.

Limitations

  • Only supports non-negative integers up to 32 bits; there's no signed or wider-width mode.
  • Requires at least two values in the list; a single value has nothing to AND against.

Examples

Folding AND across three values

Input

12
10
9

Output

8

12 & 10 = 8, then 8 & 9 = 8.

Two values

Input

15
9

Output

9

15 (1111 in binary) AND 9 (1001) keeps only the bits set in both: 1001 = 9.

Best Practices & Notes

Best Practices

  • Use this tool when you specifically want AND semantics (bits set in every value); for 'set in any value', use the OR calculator instead.
  • Keep all values non-negative and within 32 bits, since this tool is defined only for that range.

Developer Notes

Values are validated and parsed first, then combined with a single `reduce` using JavaScript's `&` operator followed by `>>> 0` to keep the running result in unsigned 32-bit form throughout the fold.

Integer AND Calculator Use Cases

  • Combining multiple bitmask or permission-flag values to find bits common to all of them
  • Verifying bitwise-AND logic in application code against known test values
  • Teaching how bitwise operators fold across more than two operands

Common Mistakes

  • Entering a negative number, which is rejected since bitwise AND here is only defined for non-negative integers.
  • Expecting a value larger than 4,294,967,295 to work; it's outside the fixed 32-bit width this tool uses.
  • Confusing bitwise AND (a per-bit combination) with logical AND (a true/false combination).

Tips

  • If you only have two values, the result is the same as pairwise AND; the fold matters most with three or more.
  • Pair with the Integer NOT Calculator if you also need the complement of the combined result.

References

Frequently Asked Questions