Binary to Decimal Converter
Calculate binary decimal instantly with our math tool. Shows detailed work, formulas used, and multiple solution methods.
Reviewed for accuracy by Manoj Kumar, Mathematics Educator
Binary to Decimal Converter
Calculator
Adjust values & calculateEnter your values below. Every result is computed in your browser โ no data is sent to any server.
Formula: Decimal = sum of (bit x 2^position) for each binary digit
Worked example โ 11010110 (binary) = 214 (decimal) = D6 (hex)
Formula
Decimal = sum of (bit x 2^position) for each binary digit
Each binary digit (0 or 1) is multiplied by 2 raised to the power of its position, counting from 0 on the right. The results are summed to produce the decimal equivalent.
Worked Examples
Example 1: 8-bit Binary to Decimal
Problem:Convert the binary number 11010110 to decimal.
Solution:Position values from right to left: 1 x 2^7 = 128 1 x 2^6 = 64 0 x 2^5 = 0 1 x 2^4 = 16 0 x 2^3 = 0 1 x 2^2 = 4 1 x 2^1 = 2 0 x 2^0 = 0 Sum: 128 + 64 + 0 + 16 + 0 + 4 + 2 + 0 = 214
Result:11010110 (binary) = 214 (decimal) = D6 (hex)
Example 2: Binary IP Address Octet
Problem:Convert the binary value 11000000 (first octet of 192.168.x.x) to decimal.
Solution:1 x 128 = 128 1 x 64 = 64 0 x 32 = 0 0 x 16 = 0 0 x 8 = 0 0 x 4 = 0 0 x 2 = 0 0 x 1 = 0 Sum: 128 + 64 = 192 This confirms the first octet of the common private IP range.
Result:11000000 = 192 (the start of the 192.168.x.x private range)
Frequently Asked Questions
What is the binary number system and why do computers use it?
The binary number system (base-2) uses only two digits: 0 and 1. Computers use binary because digital electronic circuits have two stable states: on (represented as 1) and off (represented as 0). These states are easy to distinguish electrically, making binary highly reliable for data processing and storage. Every piece of data in a computer, from text and images to videos and software, is ultimately represented as sequences of binary digits (bits). While humans find decimal more intuitive, binary is the natural language of digital hardware. Understanding binary is essential for computer science, networking, and any field involving digital technology.
How do you convert decimal to binary?
To convert decimal to binary, repeatedly divide the number by 2 and record the remainders. Read the remainders from bottom to top to get the binary number. For example, converting 214: 214 divided by 2 = 107 remainder 0, 107 divided by 2 = 53 remainder 1, 53 divided by 2 = 26 remainder 1, 26 divided by 2 = 13 remainder 0, 13 divided by 2 = 6 remainder 1, 6 divided by 2 = 3 remainder 0, 3 divided by 2 = 1 remainder 1, 1 divided by 2 = 0 remainder 1. Reading bottom to top: 11010110. You can verify by converting back to decimal. This division method works for any positive integer.
What are bits and bytes and how do they relate?
A bit (binary digit) is the smallest unit of data in computing, representing a single 0 or 1. A byte consists of 8 bits and can represent values from 0 to 255 in unsigned decimal (00000000 to 11111111 in binary). Bytes are the standard unit for measuring data size. A kilobyte (KB) is 1,024 bytes, a megabyte (MB) is 1,024 KB, and a gigabyte (GB) is 1,024 MB. Common data types use specific byte counts: a character typically uses 1 byte (ASCII) or 2-4 bytes (Unicode), a 32-bit integer uses 4 bytes, and a 64-bit floating point number uses 8 bytes. Understanding these relationships is fundamental to programming and data management.
What is two's complement and how does it represent negative numbers?
Two's complement is the standard method computers use to represent negative integers in binary. In an 8-bit system, the leftmost bit is the sign bit: 0 for positive, 1 for negative. To find the two's complement (negative) of a number, invert all bits and add 1. For example, 5 in 8-bit binary is 00000101. Inverting gives 11111010, adding 1 gives 11111011, which represents -5. The range of an 8-bit signed integer is -128 to 127. Two's complement is elegant because addition and subtraction work the same for signed and unsigned numbers, simplifying processor design. This is why it became the universal standard for signed integer arithmetic in computers.
How does binary relate to hexadecimal and octal?
Binary, hexadecimal, and octal are related because their bases are all powers of 2. Hexadecimal (base 16 = 2^4) maps each digit to exactly 4 binary digits, and octal (base 8 = 2^3) maps each digit to exactly 3 binary digits. This makes conversion between these bases trivial. To convert binary 11010110 to hex, group into fours from right: 1101 0110 = D6. For octal, group into threes: 11 010 110 = 326. These groupings make hex and octal convenient shorthands for binary. Hexadecimal is most common in modern computing because it aligns with byte boundaries (2 hex digits = 1 byte), while octal was historically used in older Unix systems.
What are binary arithmetic operations?
Binary arithmetic follows simple rules. For addition: 0+0=0, 0+1=1, 1+0=1, 1+1=10 (carry 1). For subtraction, borrowing works like decimal but in base 2. Multiplication is straightforward since you only multiply by 0 or 1. Binary shifts are special operations: left shift (adding a 0 on the right) multiplies by 2, and right shift (removing the rightmost bit) divides by 2. Logical operations AND, OR, XOR, and NOT operate on individual bits and are fundamental to computer processing. These operations are executed directly by hardware circuits called logic gates, making them extremely fast and efficient.
How is binary used in networking and IP addresses?
Binary is essential in networking, particularly for IP addresses and subnet masks. An IPv4 address like 192.168.1.100 is actually four 8-bit binary numbers: 11000000.10101000.00000001.01100100. Subnet masks use binary to separate the network and host portions of an address. For example, a /24 subnet mask is 11111111.11111111.11111111.00000000 (255.255.255.0). Routers perform bitwise AND operations between IP addresses and subnet masks to determine network membership. Understanding binary is crucial for network administrators when planning subnets, troubleshooting connectivity, and configuring access control lists. IPv6 uses 128-bit addresses, making binary understanding even more important.
What is binary-coded decimal (BCD) and when is it used?
Binary-coded decimal represents each decimal digit with its 4-bit binary equivalent. For example, the decimal number 92 in BCD is 1001 0010 (9 = 1001, 2 = 0010), whereas in pure binary 92 is 1011100. BCD wastes some bit combinations (1010 through 1111 are unused) but makes decimal display straightforward. BCD is used in digital clocks, calculators, financial systems, and any application where exact decimal representation is important. Financial calculations use BCD to avoid rounding errors that occur with floating-point binary representation. It is also used in older mainframe systems and in communication protocols that transmit decimal data.
What are powers of 2 and why are they important in computing?
Powers of 2 (1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, etc.) are fundamental to computing because they represent the capacity of binary systems. An n-bit number can represent 2^n different values. Common powers include 2^8 = 256 (values in a byte), 2^10 = 1024 (a kilobyte), 2^16 = 65536 (values in a 16-bit integer), and 2^32 = 4,294,967,296 (IPv4 address space). Memory sizes, data bus widths, and address spaces are all powers of 2. Recognizing powers of 2 helps programmers choose appropriate data types, understand memory allocation, and optimize algorithms. They also appear in divide-and-conquer algorithms and balanced tree data structures.
References
Reviewed for accuracy by Manoj Kumar, Mathematics Educator ยท Editorial policy
Related Calculators
๐งฎBinary Hex Decimal Octal Converter
Calculate binary hex decimal octal converter with inputs, formulas, and instant results.
๐งฎBinary Fraction Converter
Calculate binary fraction converter with inputs, formulas, and instant results.
๐งฎFraction to Decimal Converter
Calculate fraction to decimal converter with inputs, formulas, and instant results.
๐งฎDecimal to Percent Converter
Calculate decimal to percent converter with inputs, formulas, and instant results.
๐งฎHex to Decimal Converter
Calculate hex to decimal converter with inputs, formulas, and instant results.
๐งฎDegrees to Radians Converter
Calculate degrees to radians converter with inputs, formulas, and instant results.
๐งฎRadians to Degrees Converter
Calculate radians to degrees converter with inputs, formulas, and instant results.
๐งฎDecimal Calculator
Calculate decimal with inputs, formulas, and instant results.