Updated on May 5th, 2026

Binary Calculator

Created By Jehan Wadia

Conversion Direction
Input
Result
170 ₁₀
Binary
10101010
Decimal₁₀
170
Hexadecimal₁₆
AA
Octal
252
Calculation Steps
Operation
Operands
Decimal: 204
Decimal: 170
Result
11001100 + 10101010 =
101110110
Binary
Binary
101110110
Decimal₁₀
374
Hexadecimal₁₆
176
Octal
566
101110110
Calculation Steps

Introduction

A binary calculator is a tool that helps you work with binary numbers — the base-2 number system that uses only 0s and 1s. Computers use binary to store and process all data, which makes understanding it an important part of learning how numbers work across different systems.

This binary calculator has two modes. The Converter lets you switch numbers between binary, decimal, hexadecimal, and octal. Just pick a conversion direction, type in your number, and get instant results in all four number bases at once. It also shows you the step-by-step math so you can see exactly how each conversion works.

The Calculator mode lets you perform operations directly on binary numbers. You can add, subtract, multiply, and divide, as well as use bitwise operations like AND, OR, XOR, and NOT. It also supports left and right bit shifting. Every result is displayed in binary, decimal, hexadecimal, and octal, with full working steps shown below.

Whether you are a student learning about number systems, a programmer working with low-level data, or just curious about how binary math works, this tool gives you fast answers and clear explanations in one place.

How to Use Our Binary Calculator

This binary calculator has two modes: a Converter that changes numbers between binary, decimal, and hexadecimal, and a Calculator that performs math and logic operations on binary numbers. Enter your values, and the tool will show the result in multiple number formats along with step-by-step work.

Mode Selection: Click the "Converter" tab to switch between number systems, or click the "Calculator" tab to perform operations on binary numbers.

Converter Mode

Conversion Direction: Pick which type of conversion you want to do. You can choose from Binary to Decimal, Decimal to Binary, Binary to Hex, Hex to Binary, Decimal to Hex, or Hex to Decimal. For dedicated hexadecimal work, you can also try our Hex Calculator.

Input Value: Type the number you want to convert into the input field. Use only 0s and 1s for binary, digits 0 through 9 for decimal, or 0 through 9 and A through F for hexadecimal. The label above the field will tell you what format to use based on the direction you picked.

Convert Button: Click "Convert" to see your result. The tool will display the converted value along with the number shown in all four formats — binary, decimal, hexadecimal, and octal — plus a step-by-step breakdown of how the conversion was done.

Calculator Mode

Select Operation: Choose the math or logic operation you want to perform from the dropdown menu. Arithmetic options include Add, Subtract, Multiply, Divide, Modulo, and Exponentiation. Bitwise options include AND, OR, XOR, and NOT. You can also choose Left Shift or Right Shift. If you need a dedicated tool for modulo operations, check out our Modulo Calculator, or use our Exponent Calculator for exponentiation in decimal.

Operand 1 (Binary): Enter your first binary number using only 0s and 1s. The tool will show its decimal value beneath the field so you can double-check your input.

Operand 2 (Binary or Decimal): Enter your second binary number for most operations. If you chose a shift operation, enter a decimal number for the shift amount instead. If you chose NOT, this field will be hidden since NOT only needs one number.

Calculate Button: Click "Calculate" to see the answer. The result will appear in binary, decimal, hexadecimal, and octal formats, along with a detailed step-by-step explanation of how the operation was carried out. You can use the "Copy" button to copy the binary result to your clipboard.

Understanding Binary and Number Systems

Binary is a number system that uses only two digits: 0 and 1. It is also called the base-2 system. Every number you see on a computer screen is stored and processed as binary deep inside the machine. This makes binary one of the most important number systems in math and technology.

How Number Systems Work

In everyday life, we use the decimal system (base-10), which has ten digits: 0 through 9. Each digit's position represents a power of 10. For example, in the number 170, the 1 stands for 1 × 100, the 7 stands for 7 × 10, and the 0 stands for 0 × 1. Working with percentages and decimal-to-fraction conversions also relies on understanding this positional system.

Binary works the same way, but each position represents a power of 2 instead of 10. The binary number 10101010 breaks down like this:

  • 1 × 128 = 128
  • 0 × 64 = 0
  • 1 × 32 = 32
  • 0 × 16 = 0
  • 1 × 8 = 8
  • 0 × 4 = 0
  • 1 × 2 = 2
  • 0 × 1 = 0

Add those up and you get 170 in decimal.

Other Common Number Systems

Hexadecimal (base-16) uses 16 symbols: 0–9 and A–F. The letters A through F stand for the values 10 through 15. Programmers use hexadecimal because it is a shorter way to write binary numbers. Every group of four binary digits equals exactly one hex digit. For instance, 10101010 in binary equals AA in hexadecimal. Our Hex Calculator is a handy companion for working directly with hexadecimal values.

Octal (base-8) uses digits 0 through 7. Each group of three binary digits equals one octal digit. While less common today, octal still appears in some computing contexts like file permissions.

Binary Arithmetic and Bitwise Operations

You can add, subtract, multiply, and divide binary numbers just like decimal numbers. The rules are simpler because there are only two digits. For example, 1 + 1 in binary equals 10 (which is 2 in decimal), because you carry a 1 to the next position.

Bitwise operations work on individual bits. AND returns 1 only when both bits are 1. OR returns 1 when at least one bit is 1. XOR returns 1 when exactly one bit is 1. NOT flips every bit, turning 0s into 1s and 1s into 0s. Bit shifting slides all the bits left or right by a set number of positions. A left shift by 1 doubles the value, and a right shift by 1 halves it (dropping any remainder).

Why Binary Matters

Computers use binary because their circuits have two states: on and off. Every file, image, video, and program on your device is ultimately a long string of 0s and 1s. Learning how to convert between binary, decimal, and hexadecimal helps you understand how computers store data, how colors are coded on websites, how IP addresses work, and how basic computer logic functions. If you work with networking, tools like our Subnet Calculator, CIDR Calculator, and Bandwidth Calculator put binary knowledge into practical use. For other foundational math concepts, explore our Scientific Notation Calculator, Log Calculator, and Fraction Calculator.


Frequently Asked Questions

What is a binary number?

A binary number is a number written using only two digits: 0 and 1. It is a base-2 number system. Each digit spot stands for a power of 2, starting from the right. For example, the binary number 1011 means 8 + 0 + 2 + 1 = 11 in decimal.

How do I convert binary to decimal by hand?

Write out each bit and multiply it by its matching power of 2, starting from the right with 2⁰. Then add all the values together. For example, for 1101:

  • 1 × 2³ = 8
  • 1 × 2² = 4
  • 0 × 2¹ = 0
  • 1 × 2⁰ = 1

8 + 4 + 0 + 1 = 13 in decimal.

How do I convert decimal to binary by hand?

Divide the decimal number by 2 over and over. Write down the remainder each time. When you reach 0, read the remainders from bottom to top. For example, to convert 13:

  • 13 ÷ 2 = 6 remainder 1
  • 6 ÷ 2 = 3 remainder 0
  • 3 ÷ 2 = 1 remainder 1
  • 1 ÷ 2 = 0 remainder 1

Read bottom to top: 1101.

What is the largest binary number I can enter in this calculator?

You can enter a binary number up to 64 digits long. That means the largest value you can input is 64 ones (1111...1111), which equals 2⁶⁴ − 1, or 18,446,744,073,709,551,615 in decimal.

What does the AND bitwise operation do?

AND compares two binary numbers bit by bit. It returns 1 only when both bits are 1. If either bit is 0, the result is 0. For example, 1100 AND 1010 = 1000.

What does the OR bitwise operation do?

OR compares two binary numbers bit by bit. It returns 1 when at least one of the bits is 1. It only returns 0 when both bits are 0. For example, 1100 OR 1010 = 1110.

What does the XOR bitwise operation do?

XOR compares two binary numbers bit by bit. It returns 1 when the two bits are different, and 0 when they are the same. For example, 1100 XOR 1010 = 0110.

What does the NOT operation do in this calculator?

NOT flips every bit in the binary number. Each 0 becomes a 1, and each 1 becomes a 0. For example, NOT 10110 = 01001. This calculator flips only the bits you typed, so the result depends on how many digits you enter.

What is bit shifting?

Left shift (<<) moves all bits to the left by a set number of spots and fills the right side with 0s. Each left shift by 1 doubles the value. Right shift (>>) moves all bits to the right, dropping bits that fall off the end. Each right shift by 1 halves the value and drops any remainder.

How does binary addition work?

Binary addition follows simple rules:

  • 0 + 0 = 0
  • 0 + 1 = 1
  • 1 + 0 = 1
  • 1 + 1 = 10 (write 0, carry 1)

You work from right to left, carrying over just like in regular decimal addition. For example, 1011 + 1101 = 11000.

Can this calculator handle negative results?

Yes. If you subtract a larger binary number from a smaller one, the result will show a negative sign. For example, 100 − 1000 gives −100 in binary, which is −4 in decimal.

Why does the converter show octal results too?

Octal (base-8) is another number system used in some areas of computing. Whenever you convert a number, this tool shows it in all four common bases — binary, decimal, hexadecimal, and octal — so you can see every representation at once without doing extra work.

What happens if I enter letters in the binary input field?

The calculator will show an error message saying the input is invalid. Binary fields only accept the digits 0 and 1. Hexadecimal fields accept 0–9 and A–F, and decimal fields accept only 0–9.

How do I convert between binary and hexadecimal quickly?

Group the binary digits into sets of 4 from the right. Then convert each group to its hex digit. For example, 1010 1110 becomes AE because 1010 = A and 1110 = E. To go from hex to binary, replace each hex digit with its 4-bit binary value.

What is the modulo operation in binary?

Modulo gives you the remainder after dividing the first number by the second. The calculator converts both binary inputs to decimal, finds the remainder, and then shows it back in binary and other bases. For example, 1101 mod 100 means 13 mod 4, which equals 1 (binary: 1).

Can I use this calculator on my phone?

Yes. The calculator is designed to work on all screen sizes, including phones and tablets. The layout adjusts automatically so all buttons, fields, and results are easy to read and use on a small screen.


Related Calculators

Hex Calculator

Visit Hex Calculator