All arithmetic in a computer happens in binary. This calculator performs the four basic operations on binary numbers and shows how each is done, which makes it a handy companion for computer science courses.
How to use the Binary Calculator
- Operation
- Binary number 1
- Binary number 2
- Representation
Everything is calculated in your browser, so results appear instantly and nothing you type is sent to a server.
How it works
Choose the operation, enter two binary numbers and optionally a bit width.
Formula
Addition carries at 2 · subtraction borrows 2 · multiplication shifts and adds · division gives quotient and remainder
Worked example
Inputs — Operation: Addition +; Binary number 1: 1011; Binary number 2: 111; Representation: Automatic (fit the numbers).
Results — Result (binary) = 1 0010; Result (decimal) = 18; Number 1 in decimal = 11; Number 2 in decimal = 7; Method = carry 111
01011
+ 00111
─────
10010.
Key terms
- Binary
- Base 2, using only 0 and 1.
Frequently asked questions
How do I convert a binary result to decimal?
Add the powers of 2 for every 1 bit.
What is 1111 + 1?
10000 (15 + 1 = 16).
Why do bit widths matter?
Real registers have fixed sizes, so results can overflow.
Can I enter negative numbers?
Yes, with a leading minus sign.