Solved.tools: Free Online Calculators & Tools

We use cookies for analytics and advertising. Learn more about our cookie policy

Binary Calculator

Last updated: 27 June 2026

Reviewed by Gavin Meiring, Lead research and primary author ยท Doctoral Candidate (Corporate Governance) ยท Research and drafting assisted by AI

Was this helpful?


Binary Calculator

A binary calculator converts numbers between binary (base 2) and decimal (base 10), and performs arithmetic operations directly in binary. It is an essential tool for computer science students, programmers, and anyone working with low-level systems where data is represented in binary form.

How to Use the Binary Calculator

  1. Select your operation: conversion (binary to decimal or decimal to binary) or arithmetic (addition, subtraction, multiplication).
  2. Enter your binary number using only the digits 0 and 1, or enter a decimal number if converting to binary.
  3. For arithmetic, enter the second operand in the same format.
  4. Click Calculate to see the result in both binary and decimal.
  5. Review the step-by-step breakdown to understand how the result was reached.

The Formula

To convert a binary number to decimal, multiply each digit by 2 raised to the power of its position, counting from right to left starting at zero, then sum all values.

Decimal = d(n) x 2^n + d(n-1) x 2^(n-1) + ... + d(1) x 2^1 + d(0) x 2^0

Where d(n) is the digit at position n (either 0 or 1).

To convert decimal to binary, repeatedly divide the number by 2 and record the remainders in reverse order.

Real-World Example

Convert the binary number 1101 to decimal.

Position values: 1x2^3 + 1x2^2 + 0x2^1 + 1x2^0

= 1x8 + 1x4 + 0x2 + 1x1

= 8 + 4 + 0 + 1

= 13

So 1101 in binary equals 13 in decimal. To verify in reverse: 13 divided by 2 gives 6 remainder 1, then 6/2=3 remainder 0, then 3/2=1 remainder 1, then 1/2=0 remainder 1. Reading remainders from bottom to top gives 1101.

Why Binary Matters in Computing

All digital computers store and process information using binary because electronic circuits naturally operate in two states: on (1) and off (0). Every text character, image pixel, and program instruction is ultimately represented as a sequence of binary digits (bits). Understanding binary arithmetic helps developers debug low-level code, understand memory addressing, work with bitwise operators in languages like C, Python, and JavaScript, and read hexadecimal values in debuggers and network protocols. Groups of 8 bits form a byte, which can hold values from 0 (00000000) to 255 (11111111), the fundamental unit of digital storage.

Frequently Asked Questions

What is the difference between binary and decimal? Decimal is base 10, using digits 0 through 9, which is the number system humans use daily. Binary is base 2, using only 0 and 1, and is the native language of computers because it maps directly to the two electrical states of transistors.

Can binary numbers be negative? Yes. Computers represent negative binary numbers using a method called two's complement. To negate a binary number, flip all its bits (0 becomes 1 and vice versa) then add 1. This allows processors to handle subtraction using the same circuits as addition.

What is a bit and what is a byte? A bit is a single binary digit, either 0 or 1. A byte is a group of 8 bits. One byte can represent 256 different values (2^8). Modern computer memory and file sizes are measured in kilobytes, megabytes, and gigabytes, all multiples of bytes.

How do I add two binary numbers? Binary addition follows the same rules as decimal addition but with only two digits. 0+0=0, 1+0=1, 1+1=10 (zero with a carry of 1), and 1+1+1=11 (one with a carry of 1). Work from right to left, carrying as needed, exactly as you would with long addition in decimal.


Also try these free tools:

The first sixteen values in all three bases

Four bits cover everything from zero to fifteen, and the pattern repeats for every group of four bits in a longer number.

DecimalBinaryHexDecimalBinaryHex
000000810008
100011910019
200102101010A
300113111011B
401004121100C
501015131101D
601106141110E
701117151111F

Hexadecimal is not a separate number system so much as a shorthand for binary. One hex digit holds exactly four bits, so a byte is always two hex digits, running from 0x00 to 0xFF. Grouping 11011111 from the right gives 1101 and 1111, which read as D and F, so the byte is 0xDF, which is 223 in decimal.

The four operations, worked through

Addition. Take 1101 plus 1011, which is 13 plus 11.

Column from the rightDigitsResultCarry
11 + 101
20 + 1, plus the carry01
31 + 0, plus the carry01
41 + 1, plus the carry11
5the carry alone10

Reading the results from the top gives 11000, which is 24. Binary addition follows the same column discipline as decimal addition, with one difference: a column that reaches 2 carries instead of reaching 10.

Subtraction, using two's complement. Work in eight bits so there is room for the sign. Write 13 as 00001101 and 11 as 00001011. To negate 11, flip every bit to get 11110100 and add 1, which gives 11110101. Now add:

00001101
  • 11110101 = 100000010

The ninth bit is a carry out of the register, and dropping it leaves 00000010, which is 2. The subtraction never happened as a subtraction. The processor added a negative number, which is why one circuit handles both operations.

Multiplication. Binary multiplication is the decimal school method with a single-digit table: 0 x 0 = 0, 0 x 1 = 0, 1 x 0 = 0, 1 x 1 = 1. Take 1101 multiplied by 101.

1101 x 101
= 1101 shifted left by 2, which is 110100
+ 1101 unchanged
= 110100 + 001101
= 1000001

That is 13 x 5 = 65, and 1000001 reads as 64 + 1.

Powers of two and the positions they hold

Each position in a binary number carries a power of two, counted from zero at the right-hand end. Reading a binary number is a matter of adding the weights where a 1 appears.

PositionPowerValueBinary
02 to the 011
12 to the 1210
22 to the 24100
32 to the 381000
42 to the 41610000
52 to the 532100000
62 to the 6641000000
72 to the 712810000000
82 to the 8256100000000
92 to the 95121000000000
102 to the 10102410000000000

Storage sizes follow the same series. A kilobyte is 2 to the 10 bytes, 1024, a megabyte is 2 to the 20 bytes, 1,048,576, and a gigabyte is 2 to the 30 bytes, 1,073,741,824.

Bit width sets the range

The number of bits decides which values a register can hold, and the signed range is asymmetric because zero takes a place on the positive side.

BitsUnsigned rangeTwo's complement range
40 to 15-8 to 7
80 to 255-128 to 127
160 to 65,535-32,768 to 32,767
320 to 4,294,967,295-2,147,483,648 to 2,147,483,647

Overflow happens when a result needs one more bit than the register has. Adding 11111111 and 00000001 in eight bits gives 100000000, and dropping the carry leaves 00000000. On an unsigned register that wraps from 255 to 0, and a program that expects a growing count will not see the wrap unless it checks for it.

Fractions and what binary cannot hold exactly

Whole numbers convert cleanly in both directions. Fractions do not always. Take one tenth, written 0.1 in decimal. In binary the expansion repeats forever: 0.0001100110011001..., the same way one third repeats in decimal. IEEE 754 double precision stores 64 bits, with 52 of them holding the significand, and it cannot represent one tenth exactly. The visible consequence is that 0.1 plus 0.2 evaluates to 0.30000000000000004 in double precision rather than 0.3. Money, measurements and comparisons all suffer from this, which is why accounting code counts in whole cents and why comparing two floating point values for exact equality is a mistake.

Method and assumptions

  • Every digit is weighted by the base raised to its position, counting from zero at the right. The same rule converts decimal to binary in reverse.
  • Converting decimal to binary by repeated division by 2 and reading the remainders upward produces the same result as the positional method, and it is the faster route by hand.
  • Two's complement represents negative numbers by flipping all bits and adding 1. It costs one bit of range in exchange for one circuit that performs both addition and subtraction.
  • Values on this page are whole numbers unless a fraction is stated. Binary arithmetic on whole numbers is exact inside the bit width; floating point arithmetic is not.
  • A leading zero carries no value but records the width, which is why 00001101 and 1101 both mean 13 while only the first is a valid eight-bit pattern.

A note on how machines store numbers

IEEE 754 is the standard that defines how floating point values are laid out in a register, and the format described above is the double precision member of that family. Integers are usually stored in the two's complement form shown here. The byte remains the unit of addressable storage in general purpose computers, which is why hexadecimal output groups digits in fours and why a memory dump is read two hex digits at a time.