Skip to content

Menu

Binary Calculator

Perform binary arithmetic operations with decimal and hex results.

Runs entirely in your browserMath & FinanceFree, no sign-up
Loading tool

01What is Binary Calculator?

Binary Calculator takes two unsigned binary numbers and applies one of seven operations. You get four arithmetic ones (+, -, *, /) and three bitwise ones (AND, OR, XOR). It is the tool to reach for when you are poking at flags, masks and register values, not when you want a step-by-step lesson. Type into Binary A and Binary B. Both fields keep only 0 and 1, so stray spaces or a pasted 0b prefix get stripped as you type. The decimal value of each operand appears under its field. Pick an operation button and the answer updates straight away, with no Calculate button to press. The result card shows Binary, Decimal, Hex and Octal rows. Under the hood both inputs become JavaScript BigInt values. That matters once you go past 53 bits, the point where ordinary JavaScript numbers stop holding every integer exactly. Here a 64-bit or 128-bit value comes out digit for digit. The bitwise operators follow the usual definitions found in C, Java and JavaScript. The two numbers are lined up on the right and compared bit by bit. AND keeps bits set in both, OR keeps bits set in either, and XOR keeps bits that differ. Leading zeros are not shown in the result, so 1100 XOR 1010 prints as 110 rather than 0110. A worked example: enter 1111 and 1111 and choose *. You get Binary 11100001, Decimal 225, Hex E1 and Octal 341. Fifteen times fifteen needs eight bits, double the width of each input, which is the general rule for multiplying two N-bit numbers. Subtraction below zero gives a signed result with a minus sign, such as -100 for -4. We chose that over a two's complement pattern because only you know if your register is 8, 16, 32 or 64 bits wide. Division is integer division. The quotient is the result and a separate Remainder row shows what is left, in binary with the decimal value in brackets. Dividing by zero shows "Cannot divide by zero." instead of a number. What it does not do: there is no NOT, no shifts and no rotate, since all three depend on a fixed bit width. Inputs cannot be negative or fractional either. The maths runs in your browser tab, so register values from a private project never leave your machine.

Embedded and systems programmers testing bitmasks and register values, plus students checking binary arithmetic and bitwise homework. The tool runs entirely in your browser, so your data never leaves your device.

02How to use Binary Calculator

  1. Type the first number into Binary A (only 0 and 1 are kept)
  2. Click an operation: +, -, *, /, AND, OR or XOR
  3. Type the second number into Binary B
  4. Read the Binary, Decimal, Hex and Octal result rows, which update as you type
  5. For division, also read the Remainder row, shown in binary with the decimal value in brackets

03Worked examples

Input: 1010 + 0110
Result: Binary 10000, Decimal 16, Hex 10, Octal 20
10 + 6 = 16 needs a fifth bit, so the result is one digit longer than either input.
Input: 0110 - 1010
Result: Binary -100, Decimal -4, Hex -4, Octal -4
Negative results are shown with a minus sign, not as a fixed-width two's complement bit pattern.
Input: 1101 / 0011
Result: Binary 100 (Decimal 4), Remainder 1 (1)
Division is integer division: 13 / 3 = 4 with the remainder shown on its own row.
Input: 1100 AND 1010
Result: Binary 1000, Decimal 8, Hex 8, Octal 10
AND keeps only the bit that is 1 in both inputs.
Input: 1100 XOR 1010
Result: Binary 110, Decimal 6, Hex 6, Octal 6
XOR keeps bits that differ; the leading zero of 0110 is not shown.
Input: 1001 OR 0110
Result: Binary 1111, Decimal 15, Hex F, Octal 17
OR sets every bit that is 1 in either input, so these two halves combine into a full nibble.

04Common use cases

  • Checking which permission flags survive when a user's bitmask is ANDed with a role mask
  • Combining feature-flag bits with OR and confirming the result in hex for a config file
  • Using XOR to see exactly which bits differ between two register values
  • Verifying a hand-worked binary multiplication or division for a computer architecture course
  • Converting an arithmetic result straight into hex or octal for use in code
  • Checking that a 64-bit ID or bitfield sum stays exact where a spreadsheet or plain JavaScript number would round

05Tips

  • Operands of different lengths are aligned on the right, so leading zeros never change the result
  • A negative result is shown as a signed value; to get the two's complement bit pattern for N bits, add 2^N to it
  • XOR of a value with itself is always 0, which makes XOR handy for spotting the differing bits between two values
  • ANDing with a mask of all 1s in the low N bits keeps only those bits, which is how many protocols pull a field out of a packed integer

06Related concepts

Bitwise operations, Two's complement, Bit masking, Integer division, BigInt.

Frequently Asked Questions

What is Binary Calculator?

Binary Calculator is a free, browser-based developer tool on AIDToolStack. Perform binary arithmetic operations with decimal and hex results. It requires no installation or sign-up and works entirely in your browser.

Is Binary Calculator free to use?

Yes. No sign-up, no fees and no usage cap.

Does Binary Calculator store my data?

No. It runs in your browser; nothing is uploaded.

Related Tools

Reviews and commentsShow

Reviews

Sign in to leave a review.

Loading reviews…

Comments

Sign in to leave a comment.

Loading comments…

What changed in AI dev tools, once a month

Renames, shutdowns, pricing changes and new MCP setups, each with a source.

Subscribe