Binary Calculator

Perform arithmetic operations with binary numbers and convert between binary, decimal, hexadecimal, and octal number systems. Perfect for computer science students and programmers.

Binary Calculator

Quick Examples

Number System Converter

Calculation Result

10110
Binary Result
Decimal:22
Hexadecimal:16
Octal:26

Step by Step

Binary A: 1010 = Decimal 10
Binary B: 1100 = Decimal 12
Operation: add
Result: 10110 = Decimal 22

Number Conversions

Binary:1010
Decimal:10
Hexadecimal:A
Octal:12

How to Use This Calculator

This binary calculator allows you to perform arithmetic and bitwise operations with binary numbers, as well as convert between different number systems.

  1. Enter your first binary number (using only 0s and 1s)
  2. Select the operation you want to perform
  3. Enter the second binary number (if required)
  4. View the result in binary, decimal, hexadecimal, and octal formats
  5. Use the converter section to convert numbers between different bases

Binary Operations

Arithmetic Operations

  • Addition: Add two binary numbers following binary arithmetic rules
  • Subtraction: Subtract one binary number from another
  • Multiplication: Multiply two binary numbers
  • Division: Divide one binary number by another

Bitwise Operations

  • AND (&): Returns 1 only when both bits are 1
  • OR (|): Returns 1 when at least one bit is 1
  • XOR (^): Returns 1 when bits are different
  • NOT (~): Inverts all bits (0 becomes 1, 1 becomes 0)
  • Left Shift (<<): Shifts bits to the left by specified positions
  • Right Shift (>>): Shifts bits to the right by specified positions

Example Calculations

Binary Addition

1010 + 1100 = 10110

In decimal: 10 + 12 = 22

Bitwise AND

1010 & 1100 = 1000

Each bit position: 1&1=1, 0&1=0, 1&0=0, 0&0=0

Left Shift

1010 << 2 = 101000

Shifts all bits 2 positions to the left (equivalent to multiplying by 4)

Frequently Asked Questions

What is binary number system?

Binary is a base-2 number system that uses only two digits: 0 and 1. It's the fundamental language of computers and digital systems.

How do I convert decimal to binary?

Divide the decimal number by 2 repeatedly and collect the remainders in reverse order. For example, 10 ÷ 2 = 5 remainder 0, 5 ÷ 2 = 2 remainder 1, 2 ÷ 2 = 1 remainder 0, 1 ÷ 2 = 0 remainder 1. Reading remainders from bottom to top: 1010.

What's the difference between logical and arithmetic shifts?

Logical shifts fill with zeros, while arithmetic right shifts preserve the sign bit. This calculator performs logical shifts for simplicity.