TFT

Do Math in Binary, Hex, and More

Add, subtract, multiply, or divide numbers in binary, hexadecimal, octal, or decimal. Perfect for low-level programming and computer science homework.

Number Base Calculator

Perform arithmetic on numbers in different bases (binary, octal, decimal, hexadecimal)

Examples

Binary: 1010 + 0101 = 1111
(10 + 5 = 15)
Hex: 1A + 0F = 29
(26 + 15 = 41)
Octal: 10 × 10 = 100
(8 × 8 = 64)
Hex: FF − 01 = FE
(255 − 1 = 254)

How the Number Base Calculator Works

This tool performs arithmetic operations (addition, subtraction, multiplication, division) on numbers in different bases. Input numbers in binary, octal, decimal, or hexadecimal, and get results in your chosen output base.

Base Arithmetic Process

  1. Select the base for each input number (Binary, Octal, Decimal, Hexadecimal)
  2. Enter the numbers using valid digits for their base
  3. Choose the operation: add (+), subtract (−), multiply (×), or divide (÷)
  4. Select the output base for the result
  5. The tool converts inputs to decimal, performs the calculation, then converts to output base
  6. Results are displayed in uppercase for hex (A-F)

Specific Use Cases

Computer Science Education

A student learning about number systems practices converting between bases and performing arithmetic. They verify their manual calculations by comparing with the tool's results.

Memory Address Calculations

A systems programmer needs to calculate memory offsets. They add a base address (0x1000) to an offset (0x4F) and get the result in hexadecimal for use in debugging.

Network Subnet Math

A network administrator calculates IP address ranges by adding subnet sizes to base addresses. Binary arithmetic helps them understand bit-level operations in subnetting.

Embedded Systems Development

An embedded developer works with register values in hexadecimal. They multiply a base register address by an index to calculate the address of a specific register in a peripheral.

Digital Logic Design

An engineer designing digital circuits uses binary arithmetic to verify their logic designs. They add binary numbers to check carry propagation and overflow conditions.

What to Know Before Using This Tool

Understanding number bases and valid digits:

  • Binary (base 2) uses digits 0-1
  • Octal (base 8) uses digits 0-7
  • Decimal (base 10) uses digits 0-9
  • Hexadecimal (base 16) uses digits 0-9 and A-F
  • Each input can have a different base - the tool handles conversion automatically
  • Division by zero returns an error message
  • Results are shown in the selected output base with clear labeling

Frequently Asked Questions

How do I add binary numbers?

Select "Binary" for both inputs, enter your binary numbers (like 1010 and 0101), choose add, and select your output base. 1010 + 0101 = 1111 in binary (10 + 5 = 15 in decimal).

What does 0x mean in hexadecimal?

"0x" is a common prefix indicating a hexadecimal number (like 0x1A = 26 in decimal). This tool doesn't require the prefix - just enter the hex digits (1A).

Can I mix different bases in one calculation?

Yes! You can add a binary number to a hexadecimal number. The tool converts both to decimal, performs the operation, then converts to your chosen output base.

Why are hex letters uppercase?

Uppercase (A-F) is the conventional format for hexadecimal in technical documentation. The tool accepts both uppercase and lowercase input but displays results in uppercase.

How do I convert decimal 255 to binary?

Enter 255 with Decimal base, enter 0 (or any number) with Decimal base, select add, and choose Binary output. The result shows 11111111.

What's the largest number I can calculate?

The tool uses JavaScript's number type, which safely handles integers up to 2^53 - 1 (about 9 quadrillion). For most practical purposes, this is more than sufficient.