Binary Calculator

Convert between binary, decimal, hexadecimal, and octal.

Number Input

Enter only 0s and 1s

Conversions

Binary (Base 2)

1010

Decimal (Base 10)

10

Hexadecimal (Base 16)

A

Octal (Base 8)

12

About This Calculator

The Binary Calculator helps you convert numbers between different number systems including binary (base 2), decimal (base 10), hexadecimal (base 16), and octal (base 8). This is essential for computer science, programming, and digital electronics.

Simply enter a number in any base (binary, decimal, or hexadecimal), and the calculator will automatically convert it to all other bases. Binary uses only 0s and 1s, hexadecimal uses 0-9 and A-F, and decimal uses 0-9.

Formula & Calculation Method

Number System Conversions:

Binary to Decimal:
Sum of each digit × 2^(position from right, 0-indexed)
Example: 1010₂ = 1×2³ + 0×2² + 1×2¹ + 0×2⁰ = 10₁₀

Decimal to Binary:
Divide by 2 repeatedly, remainder gives binary digits

Binary to Hex:
Group binary digits in groups of 4, convert each group

Hex to Binary:
Convert each hex digit to 4 binary digits

Binary (base 2) is fundamental in computing. Each digit represents a power of 2. Hexadecimal (base 16) is commonly used in programming because it's compact and aligns with bytes (2 hex digits = 1 byte = 8 bits).

How to Use This Calculator

  1. Select Input Type: Choose binary, decimal, or hexadecimal.
  2. Enter Number: Input your number in the selected base.
  3. View Conversions: See the number converted to all other bases.
  4. Copy Results: Use the copy button to copy any converted value.

Frequently Asked Questions

What is binary number system?

Binary is a base-2 number system using only two digits: 0 and 1. Each position represents a power of 2. It's the fundamental number system used in computers and digital electronics.

What is hexadecimal used for?

Hexadecimal (base 16) is widely used in programming and computer science. It uses digits 0-9 and letters A-F. Two hex digits represent one byte (8 bits), making it convenient for representing binary data.

How do I convert binary to decimal?

Multiply each binary digit by 2 raised to its position power (starting from 0 on the right), then sum all results. For example, 1010₂ = 1×2³ + 0×2² + 1×2¹ + 0×2⁰ = 8 + 0 + 2 + 0 = 10₁₀.

Can I convert negative numbers?

Yes. Enter a negative decimal (e.g. -10) and every base — binary, hexadecimal, and octal — is shown in signed-magnitude form, where the magnitude is converted and a minus sign is prepended (e.g. -10 becomes -1010 in binary, -A in hex, and -12 in octal). This keeps the sign consistent across all bases regardless of which input type you start from. Note this differs from two's complement, the fixed-width representation computers use internally, which depends on the number of bits.

Expert Reviewed

This calculator was reviewed by NumCalculators Editorial Team, Multi-disciplinary Expert Team

Updated: 12/15/2024