Binary Calculator

Convert between binary and decimal, add and subtract binary numbers with our free binary calculator

Available Calculators

What is Binary?

Binary is a base-2 number system that uses only two digits: 0 and 1. It's the fundamental language of computers, where each digit represents a power of 2. Binary numbers are essential in computer science, digital electronics, and programming.

Binary Conversion

Converting between binary and decimal is fundamental in computer science. Binary to decimal conversion involves multiplying each digit by its corresponding power of 2, while decimal to binary uses repeated division by 2.

Binary to Decimal Formula

To convert binary to decimal, multiply each digit by 2 raised to its position power:

b_n b_n-1 ... b_1 b_0 = _i = 0^n b_i × 2^i

Decimal to Binary Formula

To convert decimal to binary, repeatedly divide by 2 and collect remainders from bottom to top.

Examples of Binary Calculations

Here are several everyday situations that show how easy it is to use our binary calculator.

Example 1: Binary to Decimal

Convert the binary number 1010 to decimal.

You can use our calculator by entering:

What is 1010₂ in decimal?

The calculator returns: 10

1010₂ = 1×2³ + 0×2² + 1×2¹ + 0×2⁰
= 8 + 0 + 2 + 0
= 10₁₀

The formula used is:

1010_2 = 10_10

Example 2: Decimal to Binary

Convert the decimal number 10 to binary.

You can use our calculator by entering:

What is 10₁₀ in binary?

The calculator returns: 1010

10 ÷ 2 = 5 remainder 0
5 ÷ 2 = 2 remainder 1
2 ÷ 2 = 1 remainder 0
1 ÷ 2 = 0 remainder 1
Read remainders from bottom: 1010₂

The formula used is:

10_10 = 1010_2

Example 3: Binary Addition

Add two binary numbers: 1010 + 1100.

You can use our calculator by entering:

What is 1010₂ + 1100₂?

The calculator returns: 10110

1010₂ = 10₁₀
1100₂ = 12₁₀
10 + 12 = 22
22₁₀ = 10110₂

The formula used is:

1010_2 + 1100_2 = 10110_2

Example 4: Binary Subtraction

Subtract binary numbers: 1100 - 1010.

You can use our calculator by entering:

What is 1100₂ - 1010₂?

The calculator returns: 10

1100₂ = 12₁₀
1010₂ = 10₁₀
12 - 10 = 2
2₁₀ = 10₂

The formula used is:

1100_2 - 1010_2 = 10_2

Example 5: IP Address Conversion

Convert the binary IP address segment 11000000 to decimal.

You can use our calculator by entering:

What is 11000000₂ in decimal?

The calculator returns: 192

11000000₂ = 1×2⁷ + 1×2⁶ + 0×2⁵ + ... + 0×2⁰
= 128 + 64 = 192₁₀

The formula used is:

11000000_2 = 192_10

Example 6: Memory Size

A computer uses 8 bits to represent a byte. Convert 11111111₂ to decimal.

You can use our calculator by entering:

What is 11111111₂ in decimal?

The calculator returns: 255

11111111₂ = 2⁸ - 1 = 256 - 1 = 255₁₀

The formula used is:

11111111_2 = 255_10

Example 7: Color Values

In RGB color, each component uses 8 bits. Convert 00000000₂ to decimal for black.

You can use our calculator by entering:

What is 00000000₂ in decimal?

The calculator returns: 0

All bits are 0, so the value is 0₁₀

The formula used is:

00000000_2 = 0_10

Example 8: File Permissions

Unix file permissions use binary. Convert 111₂ (read, write, execute) to decimal.

You can use our calculator by entering:

What is 111₂ in decimal?

The calculator returns: 7

111₂ = 1×2² + 1×2¹ + 1×2⁰
= 4 + 2 + 1 = 7₁₀

The formula used is:

111_2 = 7_10

Example 9: Network Subnet

Convert subnet mask 11111111.11111111.11111111.00000000 to decimal notation.

You can use our calculator by entering:

What is 11111111.11111111.11111111.00000000 in decimal?

The calculator returns: 255.255.255.0

First three octets: 11111111₂ = 255₁₀ each
Last octet: 00000000₂ = 0₁₀
Result: 255.255.255.0

The formula used is:

Each octet: 11111111_2 = 255_10, 00000000_2 = 0_10

Example 10: Binary Addition with Carry

Add 1111₂ + 0001₂ to see how binary addition handles overflow.

You can use our calculator by entering:

What is 1111₂ + 0001₂?

The calculator returns: 10000

1111₂ = 15₁₀
0001₂ = 1₁₀
15 + 1 = 16
16₁₀ = 10000₂

The formula used is:

1111_2 + 0001_2 = 10000_2

Summary

These examples show how our binary calculator can handle:

  • •Binary to decimal conversion (1010₂ = 10₁₀)
  • •Decimal to binary conversion (10₁₀ = 1010₂)
  • •Binary addition (1010₂ + 1100₂ = 10110₂)
  • •Binary subtraction and computer science applications

You can adapt any real-life situation involving binary numbers to one of these patterns and let the calculator do the work for you.

How to Use

  1. Select the type of binary calculation you need (binary to decimal, decimal to binary, binary addition, or binary subtraction).
  2. Enter the required values in the input fields. The calculator will automatically update results in real-time.
  3. View the result and step-by-step calculation breakdown with formulas displayed using mathematical notation.

Frequently asked questions

How do I convert binary to decimal?

To convert binary to decimal, multiply each digit by its corresponding power of 2 and sum the results. For example, 1010₂ = 1×2³ + 0×2² + 1×2¹ + 0×2⁰ = 8 + 0 + 2 + 0 = 10₁₀.

How do I convert decimal to binary?

To convert decimal to binary, repeatedly divide by 2 and collect the remainders. Read the remainders from bottom to top to get the binary representation.

About this tool

Published by Online Tools Center

Last updated:

Check the units, assumptions and rounding before using a result. Health and financial estimates are educational and do not replace individual professional advice.

Found an error? Send the tool name, inputs, expected result and actual result so we can investigate.

Report a problem