Command Palette

Search for a command to run...

BI

Binary Calculator

Add, subtract, multiply, and divide binary numbers, or run AND, OR, XOR, NOT, and bit shifts, with every result shown in binary, octal, decimal, and hex. 100% client-side.

What is a Binary Calculator?

A binary calculator performs arithmetic and bitwise operations on integers written in base two. Enter two numbers, choose an operation such as add, subtract, multiply, divide, AND, OR, XOR, or a bit shift, and the tool returns the answer with every step shown in binary, octal, decimal, and hexadecimal at once. You are not limited to base two either: switch the input base and you can add a hex value to another hex value, or XOR two decimal numbers, without converting anything by hand first.

Because every operand and result is displayed in all four bases, the same page is a binary math calculator and a base converter. Set the input base to decimal and add 200 and 55: the answer 255 appears as 11111111 in binary and FF in hex. That covers the decimal to binary calculator and binary to hexadecimal calculator jobs without opening a separate tool, and to convert a single number you can simply add 0 to it.

Two families of operations behave differently, and the tool keeps them separate. Arithmetic (add, subtract, multiply, divide, modulo) works on the true mathematical value, so it is exact no matter how many digits you enter and division reports the integer quotient along with any remainder. Bitwise operations (AND, OR, XOR, NAND, NOR, XNOR, NOT, and left and right shifts) act on the raw bit pattern inside a fixed register, so they depend on a chosen width. That is why the tool lets you pick 8, 16, 32, or 64 bits: NOT of a number, or a shift that pushes bits off the end, only has a defined answer once you know how wide the register is, exactly as in C, Java, Go, or Rust.

Fixed-width bitwise results are shown using two's-complement, the representation nearly every processor uses for signed integers. When a bitwise result has its top bit set, the tool reports both the unsigned reading and the signed reading, so you can see why ~5 becomes 250 in eight unsigned bits but −6 when the same bits are read as signed. Everything runs in your browser using JavaScript BigInt, so values never overflow silently and nothing you enter is uploaded, logged, or stored. The calculator keeps working with your network disconnected once the page has loaded.

How to use the Binary Calculator?

  1. Choose the input base

    Pick binary, octal, decimal, or hex for the numbers you are entering. Both operands are read in the base you select, and prefixes like 0b, 0o, and 0x are accepted and ignored.

  2. Enter the numbers and pick an operation

    Type the first value, choose add, subtract, multiply, divide, modulo, or a bitwise operation such as AND, OR, XOR, NOT, or a shift, then type the second value. NOT and shifts use only the first operand and the amount.

  3. Set the bit width for bitwise work

    For AND, OR, XOR, NOT, NAND, NOR, XNOR, and shifts, select 8, 16, 32, or 64 bits. Arithmetic ignores the width and stays exact at any size, while bitwise results are computed inside that register.

  4. Read every base and copy

    The result appears in binary, octal, decimal, and hex together, with a signed reading for bitwise answers and a remainder for division. Copy any representation with one click.

Key Features

  • Arithmetic and bitwise in one tool

    Add, subtract, multiply, divide, and take modulo, or switch to AND, OR, XOR, NAND, NOR, XNOR, NOT, and left and right shifts, without leaving the page or converting bases by hand.

  • Every base at once

    Each operand and the result are displayed in binary, octal, decimal, and hexadecimal together, so you never run a separate base conversion to check an answer.

  • Selectable bit width

    Choose an 8, 16, 32, or 64-bit register for bitwise operations so NOT and shifts behave exactly as they would in a fixed-width integer type in C, Java, or Rust.

  • Signed and unsigned readings

    When a bitwise result has its top bit set, the tool shows both the unsigned value and the signed two's-complement value, making sign behaviour visible instead of surprising.

Frequently Asked Questions

Set the input base to binary, type the first number, choose Add, type the second number, and read the result. For example, 1010 plus 1100 is 10110, which the tool also shows as 22 in decimal, 26 in octal, and 16 in hex. Arithmetic is exact at any length.

Comments

0 comments

0/2000 characters

No comments yet. Be the first to share your thoughts!

binary calculatorbinary additionbinary subtractionbinary multiplicationbitwise calculatorbinary and or xorbit shift calculatortwos complement calculatorhex binary calculatorbinary math calculatorbinary number calculatorcalculator for binary numbersbinary to hexadecimal calculatordecimal to binary calculator