What is Binary?

Binary is a base-2 number system that uses only two digits: 0 and 1. While humans count in base 10 (using digits 0–9), computers use binary because electronic circuits can easily represent two states: on (1) and off (0).

How to Convert Binary to Decimal

Each position in a binary number represents a power of 2, starting from the right (2^0 = 1, 2^1 = 2, 2^2 = 4, 2^3 = 8, and so on). To convert, multiply each digit by its position value and add them all up.

Example: 1011 in binary

How to Convert Decimal to Binary

Divide the number by 2 repeatedly and record the remainders. Read the remainders from bottom to top.

Example: 13 in decimal

Common Binary Values to Memorize

Use our free binary converter to convert between decimal, binary, hex and octal instantly.

Step-by-Step Conversion Examples

Understanding IPv4 Addresses in Binary

Every IP address on the internet is stored as four 8-bit binary numbers. The address 192.168.1.1 breaks down as:

Each octet must stay within 0–255 because that's the maximum value of 8 bits (2⁸ − 1 = 255). This is why IP addresses can never contain a number above 255 — it would require more than one byte. A /24 subnet mask (255.255.255.0) = 11111111.11111111.11111111.00000000 in binary.

ASCII: How Text is Stored as Binary

Every character you type is stored as a binary number. In ASCII encoding:

Verification: 01000001 = 0+64+0+0+0+0+0+1 = 65 = "A" ✓

The difference between uppercase "A" (65) and lowercase "a" (97) is exactly 32 — the value of bit 5. Toggling bit 5 switches between upper and lowercase for any ASCII letter. Modern systems use UTF-8, which is backward-compatible with ASCII for all characters below 128.

Converting a 16-Bit Value

In computing, 16-bit values are common — integers, audio samples, port numbers. Let's convert binary 1100101000111110 to decimal:

This same value is representable as 0xCA3E in hexadecimal (C=12, A=10, 3=3, E=14) — one hex digit per 4 bits. This is why programmers prefer hex for reading binary values larger than one byte.

Negative Numbers: Two's Complement

CPUs don't store negative numbers as "minus sign + value." They use two's complement: flip all bits, then add 1. For −13 in 8-bit signed representation:

Verification: 11110011 as unsigned = 128+64+32+16+2+1 = 243. As signed: 243 − 256 = −13 ✓

This is why signed 8-bit integers range from −128 to +127, not 0–255. The highest bit acts as the sign bit: 0 = positive, 1 = negative. A signed 8-bit −128 = 10000000 has no positive equivalent within the same range (128 doesn't fit), making it an asymmetric range.

Source: IEEE 754 floating-point standard; Unicode Consortium UTF-8 specification. Last verified: May 2026.

Frequently Asked Questions

How do I convert binary to decimal by hand?

Write down each binary digit and multiply it by its positional value (powers of 2 from right to left: 1, 2, 4, 8, 16...). Add up the results. Example: 1101 = (1×8) + (1×4) + (0×2) + (1×1) = 8+4+0+1 = 13. Our converter handles this instantly for any size number.

Why do computers use binary?

Computers use binary because electronic circuits naturally operate in two states: on (1) or off (0). Using a two-state system makes hardware simpler, more reliable, and less error-prone than trying to represent ten distinct voltage levels for a decimal system. Every program, image, and file on your computer is ultimately stored as binary.

What is the largest number you can represent with 8 bits?

With 8 bits (one byte), you can represent numbers from 0 to 255 (2⁸ − 1 = 255). For signed integers (positive and negative), the range is −128 to +127. This is why IPv4 addresses have values from 0 to 255 in each octet — each octet is exactly one byte.

Convert between decimal, binary, hexadecimal, and octal instantly.

⚡ Binary & Number Systems Converter — Free

Accuracy note: Conversion factors on SwiftConvertHub are sourced from NIST and IEC standards. Results are accurate for general use. For safety-critical or professional applications, verify results independently. Full disclaimer →

👤
Written by
Victor A. Calvo S.

Victor A. Calvo S. is a software engineer and digital entrepreneur who builds practical, free tools for developers, students, and professionals worldwide. He is the creator of SwiftConvertHub, InstantLinkHub, and Feexio. All conversion factors are cross-referenced against NIST and IEC standards. Learn more →