Math Tools

Binary Calculator

Convert between binary, decimal, hex, and octal. Perform arithmetic on binary numbers and see results in all bases.

Result (decimal)

Enter two valid binary numbers and select an operation

Binary
Decimal
Hexadecimal
Octal

Tip: The calculator updates instantly as you type. Enter only 0s and 1s for binary numbers.

What is the Binary Calculator?

A binary calculator is a tool that works with numbers in different bases—binary (base 2), decimal (base 10), hexadecimal (base 16), and octal (base 8). It lets you convert a number from one base to another instantly, and perform addition, subtraction, multiplication, and division on binary numbers. Binary uses only 0s and 1s and is the language computers use internally.

How it works

The calculator has two modes. In Arithmetic mode, enter two binary numbers, select an operation (add, subtract, multiply, divide), and it computes the result in all four bases at once. In Convert mode, enter a number in any base, select your source and target bases, and the calculator instantly converts it. All conversions work through decimal as an intermediary.

Binary to Decimal: multiply each bit by 2^position | Decimal to Binary: repeatedly divide by 2 | Hex/Octal: convert to decimal first, then to target base

Binary positional notation means the rightmost digit is 2^0, next is 2^1, then 2^2, etc. For example, 1010 in binary = (1×2³) + (0×2²) + (1×2¹) + (0×2⁰) = 8 + 0 + 2 + 0 = 10 in decimal. Hexadecimal uses digits 0-9 and A-F (A=10, F=15); octal uses only 0-7.

Examples

InputResultNotes
Convert 1010 from binary to decimal10(1×8) + (0×4) + (1×2) + (0×1) = 10. This 4-bit binary number equals 10 in decimal.
Add 1010 + 0011 in binary1101 (13 in decimal)10 + 3 = 13 in decimal, which is 1101 in binary. Like decimal addition but with only 0s and 1s.
Convert 255 decimal to hexadecimalFF255 = (15×16) + 15 = FF in hex. Common in color codes and memory addresses.

How to use the Binary Calculator

  1. Choose Arithmetic mode to do math on binary numbers, or Convert mode to change bases.
  2. In Arithmetic: enter two binary numbers (only 0s and 1s), pick an operation (+, -, ×, ÷), and see the result.
  3. In Convert: enter a number, select its current base, pick your target base.
  4. The calculator instantly displays the result and shows it in all four bases—binary, decimal, hex, octal.
  5. Use the stats section to see your result represented in every base at once.
  6. Verify results by converting back—if 10 decimal becomes FF hex, FF hex should convert back to 10 decimal.

Benefits

  • Essential for programmers: hexadecimal and octal conversions are fundamental in coding, debugging, and memory inspection.
  • Instant base conversion eliminates manual calculation errors—no need to count powers of 2 by hand.
  • Arithmetic mode lets you work directly in binary without converting back and forth, saving time.
  • All four representations (binary, decimal, hex, octal) appear at once, making relationships between bases crystal clear.
  • Free, no sign-up, works offline—use it whenever you need to understand how numbers look in different bases.
  • Perfect for learning: students can see exactly how binary positional notation and place values work.

Tips & common mistakes

Common mistakes

  • Entering non-binary digits in binary mode: binary only uses 0 and 1; 2 is not valid.
  • Confusing hex letters: A=10, B=11, C=12, D=13, E=14, F=15. Hex goes 0-9, A-F, not 0-F, A-Z.
  • Forgetting that division in binary calculator rounds down (floor division)—3 ÷ 2 = 1, not 1.5.
  • Misreading bit position: the rightmost bit is 2⁰ (position 0), not position 1.

Tips

  • Memorize key powers of 2: 2⁰=1, 2¹=2, 2²=4, 2³=8, 2⁴=16, 2⁵=32, 2⁶=64, 2⁷=128, 2⁸=256. These anchor binary-to-decimal conversions.
  • Hex is compact: 4 binary digits = 1 hex digit, so 1010 0011 (8 bits) = A3 (2 hex digits). Great for representing large binary numbers.
  • Octal groups binary by threes: 001 010 011 = 123 octal. Less common than hex in modern programming but still useful.
  • In programming, hex is preferred for readability: 0xFF is clearer than 11111111 (both are 255 decimal).

Frequently asked questions

Why do computers use binary?

Binary (two states: on/off, high/low voltage) is natural for electronics. Every bit can be stored and processed reliably, and binary arithmetic is simple for circuits to perform.

Why is hexadecimal used in programming?

Hex is compact—4 binary bits fit in 1 hex digit. Memory addresses, color codes (#FF5733), and machine code are all clearer in hex than in long binary strings.

Can I do negative number arithmetic?

This calculator works with non-negative integers. For negative numbers, computers use techniques like two's complement, which is beyond this basic converter.

What's the largest number I can enter?

The calculator handles numbers up to JavaScript's safe integer limit (2⁵³ - 1). Anything larger may lose precision.

Are leading zeros significant in binary or hex?

No. 0011 and 11 are the same (both = 3 decimal). Leading zeros don't change the value, only the representation format.

Why is subtraction sometimes disabled or shows a dash?

Subtraction that results in a negative number is not displayed because this calculator focuses on non-negative integers and binary representation assumes unsigned values.

Related tools

FreeToolz Editorial Team · Last reviewed July 2026

Reviewed for accuracy. Results are estimates for general information and are not professional (medical, financial or legal) advice.