Language
English English Vietnamese (Tiếng Việt) Vietnamese (Tiếng Việt) Chinese (简体中文) Chinese (简体中文) Portuguese (Brazil) (Português do Brasil) Portuguese (Brazil) (Português do Brasil) Spanish (Español) Spanish (Español) Indonesian (Bahasa Indonesia) Indonesian (Bahasa Indonesia)
Base Arithmetic Calculator

Base Arithmetic Calculator

Do arithmetic and bitwise operations directly on binary, octal, and hexadecimal numbers, with results shown in all four bases at once.

Binary Calculator for Base Math and Bitwise Operations

This binary calculator lets you do arithmetic directly on binary, octal, and hexadecimal numbers without converting to decimal first. Pick a base, type two values, choose an operator, and the result appears at once in all four number systems — binary, octal, decimal, and hex.

Beyond standard arithmetic, you can run bitwise operations — AND, OR, XOR, left shift, and right shift — in binary mode. It is built for programmers, computer science students, and anyone working with low-level computing, color codes, file permissions, or memory addresses.

Private by design: every calculation runs in your browser. Your values and results are never uploaded to a server.

How to Use the Base Arithmetic Calculator

1

Pick your number base

Choose a tab: Binary (digits 0–1), Octal (digits 0–7), or Hexadecimal (digits 0–9 and A–F). The input prefix and placeholder update to match.

2

Enter your two values

Type the first value in the top field and the second in the bottom field. Input is validated as you type, and any character that is invalid for the selected base is flagged with a red border.

3

Choose an operator

Select an arithmetic operator — add, subtract, multiply, divide, or modulo. In Binary mode you also get the bitwise operators: AND, OR, XOR, left shift, and right shift.

4

Calculate and read the result

Click Calculate or press Enter. The answer is shown in binary, octal, decimal, and hexadecimal at the same time, with the active base highlighted. Use the copy button on any row to grab that format.

Features

Multi-Base Support

Work directly in binary (base 2), octal (base 8), or hexadecimal (base 16) — no manual conversion needed.

Complete Arithmetic Operations

Add, subtract, multiply, divide, and take the modulo (remainder) of numbers in any supported base.

Bitwise Operations

In Binary mode, run AND, OR, XOR, left shift, and right shift for low-level and programming tasks.

Multi-Format Results

Every answer is displayed in binary, octal, decimal, and hexadecimal at once, with the active base highlighted.

Large Number Support

Calculations use BigInt, so you can work with very large integers far beyond the normal number limit.

Live Input Validation

Each field is checked as you type and flags invalid characters for the selected base with a red border.

One-Click Examples

Tap any built-in example to auto-fill both values and the operator, then calculate the result instantly.

Copy Any Format

Copy the binary, octal, decimal, or hex result to your clipboard with a single click.

Operator Reference

Open the built-in reference for each operator's name and a worked example, handy when you forget what a symbol does.

Keyboard Friendly

Press Enter from either input field to calculate, and use Clear to reset both values and the result.

Frequently Asked Questions

How do you add two binary numbers?

Binary addition uses only 0 and 1 and carries over at 2 instead of 10, so 1 + 1 equals 10 (which is 2 in decimal). With this calculator you skip the carry math: choose the Binary tab, enter both values, pick the add operator, and the sum appears in binary, octal, decimal, and hex.

How do you subtract or multiply binary numbers?

Stay in Binary mode, enter your two values, and choose the subtract or multiply operator. The calculator handles the borrowing and shifting for you and shows the result across all four bases. If a subtraction produces a negative number, the answer is shown with a leading minus sign.

Can I do math directly in hexadecimal or octal?

Yes. Switch to the Hexadecimal or Octal tab and the calculator accepts and operates on those digits directly — hex takes 0–9 and A–F, octal takes 0–7. You do not have to convert to decimal first; the result is still shown in all four number systems.

Why are bitwise operations only available in binary mode?

Bitwise operators (AND, OR, XOR, and the shifts) act on individual bits, so they are clearest in binary where every digit is one bit. This calculator surfaces those operators only on the Binary tab; you can still see the bitwise result in hex and octal in the results panel.

What is a bitwise left or right shift?

A left shift moves every bit to the left by a set number of positions, which multiplies the value by 2 for each step — so 1 left-shifted by 4 equals 16. A right shift moves bits the other way and divides by powers of 2. Shifts are fast at the hardware level and common for efficient multiplication or division by powers of two.

How do I do binary modulo (the remainder)?

Choose the modulo operator (%) to get the remainder of dividing the first value by the second. It works in every base. If the second value is zero the calculator stops and shows a "cannot modulo by zero" message instead of an invalid result.

What is the largest number this calculator can handle?

Calculations run on BigInt, which handles arbitrarily large integers, so you can work with values like DEADBEEF in hex or long binary strings without overflow errors.

Why does my input show a red border?

A red border means a character is not valid for the selected base. Binary accepts only 0–1, octal accepts 0–7, and hexadecimal accepts 0–9 and A–F. Remove the flagged characters or switch to the base that matches your number.

0b
0b
BIN
OCT
DEC
HEX
Enter values to calculate
Try examples
Operator Name Example
+ Addition 1010 + 0101 = 1111
Subtraction 1010 − 0011 = 0111
× Multiplication 1010 × 0010 = 10100
÷ Division 1010 ÷ 0010 = 0101
% Modulo 1010 % 0011 = 0001
& AND 1010 & 1100 = 1000
| OR 1010 | 1100 = 1110
^ XOR 1010 ^ 1100 = 0110
« Left Shift 0001 << 4 = 10000
» Right Shift 1000 >> 2 = 0010
Select a tab (Binary, Octal, or Hexadecimal) to choose the number base
Enter values using valid digits for the selected base
Bitwise operations (AND, OR, XOR, left shift, right shift) are available in Binary mode only
Results are shown in all four formats: binary, octal, decimal, and hex
Press Enter or click an example to calculate instantly
Want to learn more? Read documentation →
1/6
Start typing to search...
Searching...
No results found
Try searching with different keywords