Add, subtract, multiply, divide, or apply logical operations (AND/OR/XOR) on binary numbers.
📖 Boolean & Binary Arithmetic StandardFill in the fields on the left with your information, then press Calculate to see your result instantly. No sign-up required, and no data is sent anywhere — everything is calculated right in your browser.
The binary calculator performs basic arithmetic operations as well as logical operations (AND, OR, XOR) directly on numbers written in binary form. The calculator works by first converting the two binary numbers to their decimal values, performing the requested operation, then converting the result back to binary form. The three logical operations are fundamental in computer science and digital circuit design: AND gives 1 only if both bits are 1, OR gives 1 if at least one bit is 1, and XOR gives 1 only if the two bits differ. This tool is very useful for computer engineering and data science students and anyone learning the basics of low-level programming. These bitwise operations are applied independently to every corresponding pair of bits across the two numbers at once, which is exactly why they can be used to manipulate individual bits of data without disturbing the bits around them — a property with no simple equivalent in ordinary decimal arithmetic.
Binary arithmetic — adding, subtracting, multiplying, and dividing numbers written only in 0s and 1s — follows exactly the same rules as decimal arithmetic, just with a smaller set of digits and more frequent carrying, since a binary sum of 1+1 immediately carries over (1+1=10 in binary, equivalent to 2 in decimal). Anyone comfortable with long addition in decimal can learn binary addition quickly, because the underlying logic of carrying a value to the next column is identical.
Bitwise logical operations are a different category entirely, and they are where binary arithmetic becomes genuinely central to how computers work. AND, OR, and XOR each compare two bits and produce a single output bit based on a simple truth table: AND returns 1 only when both inputs are 1; OR returns 1 when at least one input is 1; XOR (exclusive or) returns 1 only when the two inputs differ from each other.
These operations are applied bit by bit across an entire binary number simultaneously, which gives them a genuinely useful property: they can isolate, set, or flip specific bits of data without touching any other bits. AND with a pattern of 1s and 0s (called a 'mask') can isolate specific bits of interest while zeroing out the rest — a technique used constantly in low-level programming, networking (subnet masks rely on exactly this idea), and graphics processing (extracting individual color channels from a packed pixel value).
XOR has a particularly elegant property: applying the same XOR operation twice in a row returns the original value unchanged. This reversibility is the basis for simple encryption schemes and for the classic 'swap two variables without a temporary variable' programming trick, and it also underlies parity checking, a basic error-detection method used in data storage and transmission.
Beyond pure computer science, understanding binary and bitwise logic pays off anywhere digital systems are configured directly — file permission systems, network subnetting, hardware register configuration in embedded systems, and debugging low-level code where a value is described in hexadecimal or binary rather than familiar decimal. Being able to convert and reason about binary quickly removes a real barrier to understanding what these systems are actually doing under the hood.
Only the digits 0 and 1 — any other character will trigger a validation alert.
These are bitwise logical operations: AND returns 1 only if both bits are 1, OR returns 1 if at least one bit is 1, and XOR returns 1 only if the bits differ.
Both — the main result is shown in binary, with the equivalent decimal value shown right below it.