Binary Calculator

Base 2 result

1101

Decimal result

13

All results
Calculator inputs
?

Arithmetic uses both operands in the page’s base. Conversion uses only the first entry; select decimal input before entering a base-10 value.

?

Signed binary integer in arithmetic/to-decimal mode; signed decimal integer in from-decimal mode. Up to 256 digits; optional 0b prefix only for base-2 entries.

?

Division returns a quotient truncated toward zero, a signed remainder, and a separate fractional expansion. Signed inputs are mathematical integers, not fixed-width machine bit patterns.

?

Second signed base-2 integer. For division it must be nonzero. Spaces, fractional points and thousands separators are not accepted.

Bits carry powers of two

Read each digit with its place weight. Contributions add to the signed integer result shown beside the form.

Addition columns and carries

Columns run from the units place upward. For same-sign negative addition, this is the magnitude sum and the negative sign applies afterward.

Addition columns and carries
PowerLeft digitRight digitCarry inResult digitCarry out
001010
111001
200110
310010

Base-2 place-value ledger

Complete result decomposition. Decimal contributions sum to the integer result; a negative sign applies to the magnitude as a whole.

Base-2 place-value ledger
Power kDigit2^k (decimal)Signed decimal contribution
3188
2144
1020
0111

Repeated division by 2

Read remainders from bottom to top for the magnitude. The sign is retained separately.

Repeated division by 2
Current magnitude (decimal)Quotient (decimal)Remainder (base 2)
1361
630
311
101

Binary, hexadecimal and decimal reference

Computed conversion table; leading zeroes here show a four-bit group rather than a machine word width.

Binary, hexadecimal and decimal reference
DecimalBinary (4 places)Hex
000000
100011
200102
300113
401004
501015
601106
701117
810008
910019
101010A
111011B
Rows 1–12 of 16

How to use the Binary Calculator

Perform exact binary integer arithmetic and convert to or from decimal. Inspect place values, calculation steps and division remainders without losing large-integer digits.

  1. 1. Enter your inputs

    Start with Calculate, First integer, Operation, Second integer. Use the units shown beside each field and open the field help when you need its assumptions.

  2. 2. Read the results

    Results update as you enter valid values. Review Base 2 result, Decimal result. Keep the entered units and settings consistent when comparing scenarios.

  3. 3. Check the calculation

    Signed integers only; at most 256 input digits per operand. Fractional input and fixed-width machine encodings are outside scope. Exact results are exported as strings; spreadsheets should import these columns as text.

    See the worked example and method

Understanding the Binary Calculator: uses, inputs and results

The Binary Calculator keeps integer arithmetic exact in base two while also making the decimal interpretation available.

How do I convert binary to decimal?

Each binary position has a power-of-two weight, starting with 1 on the right. A digit of 1 contributes its weight; a digit of 0 contributes nothing. For 10110, the weights are 16, 8, 4, 2 and 1, giving 16 + 4 + 2 = 22. The notation changes, but the integer does not.

The Binary Calculator includes a complete place-value ledger, not only a converted answer. Use it to identify the exact contribution of each bit and check that the contributions sum to the decimal result. A minus sign applies to the entire magnitude; it is not another binary digit.

Why does 1 + 1 equal 10 in binary?

A binary column can hold only 0 or 1. Adding two ones gives decimal 2, written as 10 in base two: write 0 in the current column and carry 1 to the next. If another carry arrives, 1 + 1 + 1 gives 11, so the written digit and the carried digit are both 1.

For 111 + 1, the carry passes through three columns and the result is 1000. The addition ledger runs from the units place upward and records carry-in, result digit and carry-out separately. Leading carry columns are included rather than clipped to a fixed number of bits.

Further reading: Python documentation: integer conversion and number formatting · ECMAScript: exact BigInt division and remainder

What do the Binary Calculator inputs mean?

Calculate
Arithmetic uses both operands in the page’s base. Conversion uses only the first entry; select decimal input before entering a base-10 value.
First integer
Signed binary integer in arithmetic/to-decimal mode; signed decimal integer in from-decimal mode. Up to 256 digits; optional 0b prefix only for base-2 entries.
Operation
Division returns a quotient truncated toward zero, a signed remainder, and a separate fractional expansion. Signed inputs are mathematical integers, not fixed-width machine bit patterns. This field applies when Calculate is set to Arithmetic.
Second integer
Second signed base-2 integer. For division it must be nonzero. Spaces, fractional points and thousands separators are not accepted. This field applies when Calculate is set to Arithmetic.
Maximum fractional digits
Maximum base-2 digits after the point in division, from 0 to 64. A cycle in parentheses repeats indefinitely; an ellipsis means a truncated preview, not a rounded result. This field applies when Operation is set to Integer divide.

When is the Binary Calculator useful?

Check binary arithmetic

Enter base-2 integers and select the supported operation to verify a computing exercise.

Compare number representations

Use the decimal conversion to confirm that the binary result represents the expected integer.

Binary Calculator: a practical reference

The fixed “Ten plus three” example on this page produces the results below. It illustrates the stated model; your live results above use your current inputs.

Calculate
Arithmetic
First integer
1010
Operation
Add
Base 2 result
1101
Decimal result
13
Review the example inputs and calculation

Use the result in context

Signed integers only; at most 256 input digits per operand. Fractional input and fixed-width machine encodings are outside scope. Exact results are exported as strings; spreadsheets should import these columns as text.

Try the Binary Calculator·Read the subject guide·Explore a related calculator

Worked example: Binary Calculator

Ten plus three. This fixed reference example shows one complete scenario; the interactive results above use your current inputs.

View the example inputs
Calculate
Arithmetic
First integer
1010
Operation
Add
Second integer
11
Calculated results for the fixed example
Calculated quantityExample result
Base 2 result1101
Decimal result13

Binary Calculator: connect every bit to its place value

How do I convert binary to decimal?

Each binary position has a power-of-two weight, starting with 1 on the right. A digit of 1 contributes its weight; a digit of 0 contributes nothing. For 10110, the weights are 16, 8, 4, 2 and 1, giving 16 + 4 + 2 = 22. The notation changes, but the integer does not.

The Binary Calculator includes a complete place-value ledger, not only a converted answer. Use it to identify the exact contribution of each bit and check that the contributions sum to the decimal result. A minus sign applies to the entire magnitude; it is not another binary digit.

Python documentation: integer conversion and number formatting

Why does 1 + 1 equal 10 in binary?

A binary column can hold only 0 or 1. Adding two ones gives decimal 2, written as 10 in base two: write 0 in the current column and carry 1 to the next. If another carry arrives, 1 + 1 + 1 gives 11, so the written digit and the carried digit are both 1.

For 111 + 1, the carry passes through three columns and the result is 1000. The addition ledger runs from the units place upward and records carry-in, result digit and carry-out separately. Leading carry columns are included rather than clipped to a fixed number of bits.

How does borrowing work in binary subtraction?

When the current top bit is too small, borrow one unit from the next binary place. That borrowed unit is worth two units in the current column. For 1000 − 1, borrowing propagates across the zeroes and the result is 111.

Signed addition and subtraction can reduce to either adding magnitudes or subtracting the smaller magnitude from the larger. The ledger explains that reduction and the result retains the mathematical sign. It does not interpret the input as an eight-bit register or silently wrap a negative result into a machine encoding.

What happens when binary division has a remainder?

Integer division and fractional division answer different questions. For 101 ÷ 10, the integer quotient is 10 with remainder 1: in decimal, 5 = 2 × 2 + 1. Continuing past the point gives 10.1 in binary, which is decimal 2.5.

The calculator preserves its integer-quotient result and shows the fractional quotient separately. Parentheses enclose a detected repeating block, while an ellipsis means the selected digit limit was reached. With negative inputs, the integer quotient truncates toward zero and the remainder takes the dividend’s sign.

ECMAScript: exact BigInt division and remainder

Can I calculate with binary integers larger than 53 bits?

Yes, within the stated 256-input-digit limit. The integer operations use exact integer arithmetic rather than converting through an ordinary floating-point number. For decimal-to-binary conversion, enter the decimal integer as text so every digit is available to the parser. API clients should also send quoted strings for large integer operands.

The complete result, place-value ledger and CSV preserve exact integer strings. A spreadsheet can still round a long integer after import, so choose text columns when retaining all digits matters. Fractional input, bitwise logic, fixed-width overflow and two’s-complement decoding are separate tasks outside this calculator’s model.

When is a Binary Calculator useful?

Use it to check base-two homework, inspect integer bit patterns or verify arithmetic before implementing a representation in code. The repeated-division table explains decimal-to-binary conversion: divide the magnitude by two and read the remainders from the final row upward.

For a network mask or a hardware field, width and interpretation still matter. The same printed bits can describe a positive magnitude, a signed machine value or several packed fields. Establish that context before applying a mathematical integer answer to a device or protocol.

Formula and calculation method

Base 2 uses place weights 2^k. Conversion changes notation, not numerical value. Inputs and integer results use exact BigInt arithmetic.

Integer division truncates toward zero. The remainder has the dividend’s sign and satisfies a = b × q + r with |r| < |b|.

Fractional division is separate from the integer quotient. Parentheses mark a detected repeat; an ellipsis marks the requested digit limit. No fixed word width, overflow wraparound or two’s-complement interpretation is assumed.

Scope and Limitations

  • Signed integers only; at most 256 input digits per operand. Fractional input and fixed-width machine encodings are outside scope. Exact results are exported as strings; spreadsheets should import these columns as text.

Reference Sources

Frequently asked questions

Are 0b prefixes accepted?

Yes, for binary operands. A sign may appear before the prefix; conversion from decimal requires decimal digits instead.

Is the division result an integer or a fraction?

Both are shown separately: an integer quotient with remainder, and a fractional expansion limited to the requested number of places.

Does the calculator use two’s complement?

No. Signed inputs are mathematical integers with a separate minus sign, without a fixed word width.

Why are there parentheses in a quotient?

They mark a detected repeating block of fractional digits. An ellipsis instead marks a truncated preview.

Can I paste a binary fraction such as 10.1?

Not as an operand. Inputs are signed integers; fractional output can be produced by division.