Binary Calculator
Convert decimal to binary and perform binary arithmetic
Binary Calculator
Convert between decimal and binary
Enter a decimal integer
Divide by 2 repeatedly and read remainders bottom-to-topWhat is a Binary Calculator?
A Binary Calculator is a tool for working with binary numbers, which are numbers written using only two digits: 0 and 1. Binary is the fundamental number system used by computers because digital circuits naturally represent two states (off/on, low/high, 0/1).
Binary numbers follow the same place-value concept as decimal numbers, but instead of powers of 10, binary uses powers of 2. For example, the binary number 1011₂ means: 1×2³ + 0×2² + 1×2¹ + 1×2⁰ = 8 + 0 + 2 + 1 = 11 in decimal.
This Calculator Supports Multiple Conversions
- Decimal → Binary -- convert base-10 numbers to base-2
- Decimal → Octal -- convert base-10 numbers to base-8
- Decimal → Hexadecimal -- convert base-10 numbers to base-16
Binary calculators are useful for converting between number bases, understanding computer science topics like bits, bytes, and data representation, and working with hexadecimal (base 16), which is commonly used to represent binary compactly.
How to Use This Binary Calculator
- Enter a decimal number -- type any integer into the input field (e.g., 255)
- Click "Calculate" -- to convert the number
- Review all three outputs -- the result shows the binary (base 2), octal (base 8), and hexadecimal (base 16) representations simultaneously
- Try other values -- explore powers of 2, common byte values (128, 255, 256), or any number you need to convert
Tips:
- A valid binary number contains only 0 and 1 (no digits 2 through 9)
- Leading zeros (like 00101) don't change the value, but they can be useful for showing fixed bit-length formats
- Hexadecimal uses digits 0–9 and letters A–F (where A=10, B=11, …, F=15)
Binary Formulas
Binary Place Value
A binary number has digits (bits) with place values based on powers of 2:
2⁰, 2¹, 2², 2³, 2⁴, …
For binary number bₖbₖ₋₁…b₁b₀, the decimal value is:
value = Σ bᵢ × 2ⁱ (i = 0 to k)
where each bᵢ is either 0 or 1
Converting Decimal to Binary
Repeatedly divide by 2 and record remainders:
- Divide the number by 2
- Record the remainder (0 or 1)
- Divide the quotient by 2 and repeat until the quotient is 0
- Read the remainders from bottom to top
Binary Addition Rules
0 + 0 = 0
0 + 1 = 1
1 + 0 = 1
1 + 1 = 10
0 carry 1
Example Calculations
Example 1: Convert Binary to Decimal
Convert: 1011₂ to decimal
Calculation: 1×2³ + 0×2² + 1×2¹ + 1×2⁰ = 8 + 0 + 2 + 1
Result: 1011₂ = 11₁₀
Example 2: Convert Decimal to Binary
Convert: 13₁₀ to binary
Steps:
- 13 ÷ 2 = 6 remainder 1
- 6 ÷ 2 = 3 remainder 0
- 3 ÷ 2 = 1 remainder 1
- 1 ÷ 2 = 0 remainder 1
Read upward: 1101
Result: 13₁₀ = 1101₂
Example 3: Binary Addition
Add: 1011₂ + 0101₂
Calculation: 1011 + 0101 = 10000
Verify: 11 + 5 = 16 in decimal
Result: 1011₂ + 0101₂ = 10000₂
Example 4: Binary Multiplication
Multiply: 101₂ × 11₂
In decimal: 5 × 3 = 15
15 in binary: 1111₂
Result: 101₂ × 11₂ = 1111₂
Frequently Asked Questions
Why do computers use binary instead of decimal?
Computers are built from electronic components that naturally represent two states (on/off). Binary matches this perfectly, making it reliable and efficient for hardware design.
What is a bit and a byte?
A bit is a single binary digit (0 or 1). A byte is typically 8 bits, which can represent 256 different values (0–255).
What's the difference between binary and hexadecimal?
Hexadecimal (base 16) is a compact way to write binary. Every 4 binary bits corresponds to one hex digit (0–9 and A–F). For example, 1111₂ = F₁₆.
Can binary numbers represent negative values?
Yes. Computers often use formats like two's complement to represent negative numbers in binary. Some binary calculators support this, but many basic tools focus on non-negative integers.
Why do binary results sometimes look "long"?
Because binary uses only 0 and 1, it needs more digits to represent large numbers. For example, 255₁₀ is 11111111₂, which is 8 bits long.
Want to add this binary calculator to your website? Get a custom embed code that matches your site's design and keeps visitors engaged.
What Is the Binary Number System?
Binary is the base-2 number system that uses only two digits: 0 and 1. Every piece of digital information — text, images, video, programs — is ultimately stored as sequences of binary digits (bits). Understanding binary is fundamental to computer science and digital electronics. At the hardware level, 0 and 1 map directly to off and on states in transistors, making binary the native language of every processor ever built.
This calculator converts between decimal (the everyday base-10 system) and binary, and can perform binary addition and subtraction. It also shows octal (base 8) and hexadecimal (base 16) equivalents, so you can see how the same value looks across the number systems most commonly used in computing and programming.
How to Use the Binary Calculator
- Enter a decimal number to convert it to binary, or enter a binary number (digits 0 and 1 only) to convert it to decimal.
- Select the conversion direction: Decimal → Binary or Binary → Decimal.
- Click Calculate to see the result.
- Read the binary result along with its octal and hexadecimal equivalents displayed below.
Conversion Formulas
Decimal to Binary: divide by 2, collect remainders (LSB first)
Example: 13 ÷ 2 = 6 R1, 6 ÷ 2 = 3 R0, 3 ÷ 2 = 1 R1, 1 ÷ 2 = 0 R1
Read remainders bottom to top: 13₁₀ = 1101₂
Binary to Decimal: multiply each bit by 2^position
1101₂ = 1×2³ + 1×2² + 0×2¹ + 1×2⁰ = 8+4+0+1 = 13
Binary addition: 0+0=0, 0+1=1, 1+0=1, 1+1=10 (carry 1)Bits are numbered right to left starting at 0. The leftmost bit is the Most Significant Bit (MSB); the rightmost is the Least Significant Bit (LSB).
Worked Examples
42₁₀ = 101010₂
Divide 42 repeatedly by 2: 42→21 R0, 21→10 R1, 10→5 R0, 5→2 R1, 2→1 R0, 1→0 R1. Reading remainders bottom to top gives 101010. Check: 32+8+2 = 42.
11111111₂ = 255₁₀ (max 8-bit value)
Eight 1-bits = 128+64+32+16+8+4+2+1 = 255. This is the maximum value an unsigned 8-bit byte can hold, which is why IP address octets range from 0 to 255.
1010₂ + 0110₂ = 10000₂ (binary addition: 10 + 6 = 16)
Add column by column from right: 0+0=0, 1+1=10 (write 0 carry 1), 0+1+1=10 (write 0 carry 1), 1+0+1=10 (write 0 carry 1). The carried 1 becomes the leading bit: result is 10000₂ = 16₁₀.