And Binary Values Online
Perform a bitwise AND operation on two binary numbers. See the result with bit-by-bit visualization.
Drop two binary strings in and get the bitwise AND — only the bits that are 1 in both values survive. You also get decimal and hex equivalents, a bit-by-bit breakdown, and optional padding to 8, 16, or 32 bits for cleaner output. And everything runs in your browser. Nothing gets uploaded.
How to Use
Enter two binary values in the input fields above. Only 0s and 1s are accepted (spaces are stripped automatically).
Choose bit padding (Auto, 8-bit, 16-bit, or 32-bit) and toggle the decimal/hex/truth-table options as needed.
Click Calculate to perform the bitwise AND operation and see the result with a bit-by-bit visualization.
Copy the result to your clipboard, or click Sample to load example binary values.
Frequently Asked Questions
What is a bitwise AND operation?
A bitwise AND compares each bit of two binary numbers. For each bit position, the result is 1 only if both corresponding bits are 1; otherwise the result is 0. For example, 1100 AND 1010 produces 1000, because only the leftmost bit position has a 1 in both inputs.
How is bitwise AND used in programming?
Bitwise AND is widely used for masking specific bits (e.g., extracting the lower 4 bits with AND 00001111), checking flags or permissions in bitmask systems, clearing specific bits to 0, and performing low-level hardware register manipulation. It is a fundamental operation in languages like C, Java, Python, and JavaScript.
What does bit padding do?
Bit padding ensures both binary values are displayed with the same number of bits. For instance, 8-bit padding shows all values as 8 digits (e.g., 00001100 instead of 1100). Auto mode pads both values to match the length of the longer input, rounding up to the nearest multiple of 4 for cleaner display.
Can I use this for values larger than 32 bits?
Yes. While the padding options offer 8, 16, and 32-bit presets, the Auto mode handles binary strings of any length. JavaScript handles bitwise operations natively for 32-bit integers, but this tool processes strings directly, so it works correctly for arbitrarily long binary values.
What is the difference between AND, OR, and XOR?
AND produces a 1 only when both bits are 1. OR produces a 1 when at least one bit is 1. XOR (exclusive OR) produces a 1 when exactly one of the two bits is 1, but not both. Each operation serves different purposes in computing: AND for masking, OR for setting bits, and XOR for toggling bits or detecting differences.