AND Calculator

Free AND Calculator — Bitwise AND Operation Online (2026)

Bitwise operations are foundational to computer science — used in everything from graphics programming to network routing to cryptography. The AND operation is the most fundamental: it outputs a 1 only when both corresponding bits are 1.

SmallSEOToolsn’s free AND calculator performs bitwise AND on any two integers and displays the result in binary, decimal, and hexadecimal — instantly.


How Bitwise AND Works

The AND operation compares two binary numbers bit by bit:

Bit ABit BA AND B
000
010
100
111

Result is 1 ONLY when both bits are 1.

Worked Example

12 AND 10 = ?

Binary
121100
101010
AND1000

1000 in decimal = 8. So 12 & 10 = 8.


Real-World Uses of Bitwise AND

Bit masking: Extract specific bits from a value. To check if the 3rd bit is set in a number: number & 0b100. If result is non-zero, the bit is set.

Checking even/odd: n & 1 — if result is 0, n is even; if 1, n is odd. Faster than modulo division.

Clearing bits: value & ~(1 << bit_position) clears a specific bit without affecting others.

Network subnetting: IP subnet masks use AND to extract network addresses. 192.168.1.75 AND 255.255.255.0 = 192.168.1.0 (network address).

Permission flags: Operating systems use bitwise AND to check file permissions. Unix permission chmod 755 uses bitwise operations internally.

Graphics programming: Color channel extraction from packed RGBA values uses AND masks.


Bitwise AND in Programming Languages

python

# Python
result = 12 & 10   # = 8

# JavaScript
result = 12 & 10;  // = 8

# C / C++
int result = 12 & 10;  // = 8

# Java
int result = 12 & 10;  // = 8

The & operator is standard across all major programming languages for bitwise AND.


AI Overview Answer

What is a bitwise AND operation? Bitwise AND compares two numbers bit by bit and returns a 1 in each position only where both input numbers have a 1. Example: 12 (1100) AND 10 (1010) = 8 (1000). It’s used in programming for bit masking, checking flags, extracting permissions, and network subnet calculations. The & operator performs bitwise AND in Python, JavaScript, Java, C, and C++.


FAQ

Q: What is the difference between AND and logical AND (&&)? A: Bitwise AND (&) operates on individual bits of integers. Logical AND (&&) operates on boolean values (true/false) and returns true only if both operands are true. Use & for bit manipulation, && for conditional logic.

Q: Can I AND negative numbers? A: Yes. Negative numbers use two’s complement representation in most systems. The AND operation still works bit by bit — but results may be unexpected if you haven’t accounted for the sign bit.

Q: What are the other bitwise operators? A: OR (|), XOR (^), NOT (~), Left Shift (<<), Right Shift (>>). Each has different truth tables and use cases.

→ Enter two numbers above to calculate their bitwise AND instantly.

Scroll to Top