Binary Converter
Convert binary numbers to decimal and back. Perfect for computer science students, programmers, and digital electronics enthusiasts.
How do I convert binary to decimal?
Binary to decimal conversion uses positional notation. Each binary digit (bit) represents a power of 2, starting from 2^0 on the right. Multiply each bit by its corresponding power of 2, then sum all results. Example: 1101 binary = (1×2^3) + (1×2^2) + (0×2^1) + (1×2^0) = 8 + 4 + 0 + 1 = 13 decimal. For fractional binary like 1101.101: digits after the point represent 2^-1, 2^-2, 2^-3, etc.
How do I convert decimal to binary?
Decimal to binary conversion uses successive division by 2. Divide the decimal number by 2, record the remainder (0 or 1), then repeat with the quotient until it reaches 0. Read the remainders from bottom to top. Example: 25 ÷ 2 = 12 rem 1, 12 ÷ 2 = 6 rem 0, 6 ÷ 2 = 3 rem 0, 3 ÷ 2 = 1 rem 1, 1 ÷ 2 = 0 rem 1. Reading upward: 11001 binary. For fractional decimals: multiply the fractional part by 2 repeatedly, recording the whole number parts.
Why is binary used in computers?
Computers use binary because it aligns with their fundamental electronic design. Transistors operate as switches with two states: on (1) or off (0). Binary provides reliable signal representation since only two voltage levels need to be distinguished, reducing errors from electrical noise. Boolean logic (AND, OR, NOT) maps naturally to binary, forming the foundation of all digital circuits. Binary also simplifies storage in magnetic and optical media, where data is encoded as magnetized or unmagnetized regions, pits and lands, or charged and uncharged states.
What is the largest binary number I can convert?
This converter handles arbitrarily large binary numbers limited only by JavaScript number precision (up to 2^53 - 1 or about 9 quadrillion for exact integers). Common binary lengths and their decimal ranges: 4 bits (nibble): 0-15, 8 bits (byte): 0-255, 16 bits: 0-65,535, 32 bits: 0-4,294,967,295, 64 bits: 0-18,446,744,073,709,551,615. For numbers beyond 53 bits, the conversion may lose precision. Always enter binary digits as 0s and 1s only; the input validator rejects invalid characters.