The binary number system is a positional number system built around powers of two. That compact definition explains the structure behind every binary integer: each position has a fixed weight, and each digit says whether that weight is included.
This guide focuses on place value, counting, bit width, and numeric range. For a broader introduction to why computers use two states, read What Is Binary?. When you need an immediate conversion rather than the underlying rules, use the binary to decimal converter or decimal to binary converter.
Binary Number System Place Values
A positional number system assigns a weight to every digit according to its location. Decimal positions use powers of ten. The binary number system uses powers of two:
| Position from the right | Power | Place value |
|---|---|---|
| 0 | 2⁰ | 1 |
| 1 | 2¹ | 2 |
| 2 | 2² | 4 |
| 3 | 2³ | 8 |
| 4 | 2⁴ | 16 |
| 5 | 2⁵ | 32 |
| 6 | 2⁶ | 64 |
| 7 | 2⁷ | 128 |
A binary digit can only be 0 or 1. A 1 includes its position's value; a 0 excludes it. This is why the binary number 101101 represents:
1×32 + 0×16 + 1×8 + 1×4 + 0×2 + 1×1
= 32 + 8 + 4 + 1
= 45The leftmost 1 is not inherently worth more. It is worth more because it occupies the 2⁵ position. Move that digit one place to the left and its weight doubles.
How to Read Binary Numbers
Start at the rightmost digit and label the positions 0, 1, 2, and so on. Convert each position to a power of two, keep the values whose digits are 1, and add them.
Consider 11001010:
| Bit | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|
| Weight | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
| Included | 128 | 64 | 0 | 0 | 8 | 0 | 2 | 0 |
The included values total 202. Writing the subscript form 11001010₂ = 202₁₀ makes the bases explicit and prevents a binary string from being mistaken for a decimal number.
You can verify any example with the binary to decimal tool, which also displays the contribution of each position.
How Counting Works in Base 2
Counting in the binary number system follows the same rollover idea as decimal counting. Decimal rolls from 9 to 10 because it has exhausted its single-digit symbols. Binary rolls from 1 to 10 because it has only two symbols.
| Decimal | Binary | What changes |
|---|---|---|
| 0 | 0 | Starting value |
| 1 | 1 | Lowest bit is set |
| 2 | 10 | Rollover creates a new position |
| 3 | 11 | Both low positions are set |
| 4 | 100 | Two trailing positions roll over |
| 5 | 101 | The 1 position is set again |
| 6 | 110 | The 2 position is added |
| 7 | 111 | All three positions are set |
| 8 | 1000 | Three positions roll over |
When adding one, scan from right to left. Change trailing 1 digits to 0 until you reach a 0, then change that 0 to 1. For example, 10111 + 1 = 11000. This carry behavior is the foundation of binary addition.
Converting Decimal to the Binary Number System
One manual method repeatedly divides a non-negative decimal integer by two and records each remainder. Read the remainders from bottom to top.
To convert 45:
| Division | Quotient | Remainder |
|---|---|---|
| 45 ÷ 2 | 22 | 1 |
| 22 ÷ 2 | 11 | 0 |
| 11 ÷ 2 | 5 | 1 |
| 5 ÷ 2 | 2 | 1 |
| 2 ÷ 2 | 1 | 0 |
| 1 ÷ 2 | 0 | 1 |
Reading upward gives 101101. The reverse place-value calculation returns 45, providing a useful self-check. For long values, the decimal to binary converter performs the same conversion without rounding.
A second method subtracts the largest power of two that fits. For 45, select 32, leaving 13; select 8, leaving 5; select 4, leaving 1; and select 1. Mark those positions as 1 and the unused positions as 0.
Bit Width and Unsigned Range
A bit width tells you how many binary positions are available. With bits, there are possible patterns. An unsigned integer uses all of them for zero and positive values, giving a range from 0 through .
| Width | Patterns | Unsigned range |
|---|---|---|
| 4 bits | 16 | 0–15 |
| 8 bits | 256 | 0–255 |
| 16 bits | 65,536 | 0–65,535 |
| 32 bits | 4,294,967,296 | 0–4,294,967,295 |
| 64 bits | 18,446,744,073,709,551,616 | 0–18,446,744,073,709,551,615 |
The largest unsigned pattern is always all 1s. For eight bits, 11111111 includes 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1, totaling 255.
Leading zeros can show a chosen width without changing the value. 101, 0101, and 00000101 all equal decimal 5, but the last two forms communicate four-bit and eight-bit formatting.
Signed Binary Integers
A bit pattern does not describe its signed interpretation by itself. A system must define both the width and the representation. Modern computers usually use two's complement.
For an n-bit two's complement integer, the range is negative 2 to the power of (n - 1) through 2 to the power of (n - 1), minus 1. An eight-bit signed integer therefore ranges from -128 to 127. The same pattern can mean different things under different interpretations: 11111111 is unsigned 255 but signed two's complement -1.
This distinction matters when moving values between APIs, files, registers, and programming language types. Always record the width and whether a field is signed.
Binary Fractions
Positions to the right of a binary point use negative powers of two: 2⁻¹ is one half, 2⁻² is one quarter, and 2⁻³ is one eighth.
For example:
10.101₂
= 1×2¹ + 0×2⁰ + 1×2⁻¹ + 0×2⁻² + 1×2⁻³
= 2 + 0.5 + 0.125
= 2.625₁₀Some decimal fractions cannot be represented with a finite number of binary fractional positions, just as one third repeats in decimal. Floating-point formats store a finite approximation, which is why seemingly simple decimal arithmetic can expose rounding differences in software.
Binary, Octal, and Hexadecimal
Octal and hexadecimal are compact ways to group binary digits. One octal digit represents three bits because (2^3 = 8). One hexadecimal digit represents four bits because (2^4 = 16).
Binary: 1101 0110
Hexadecimal: D 6
Binary: 011 010 110
Octal: 3 2 6Grouping preserves the underlying bit pattern and is faster than converting through decimal. Use the binary to hexadecimal tool or binary to octal tool to see the groups and verify a value.
Common Mistakes
- Reading place values from the left instead of beginning with 2⁰ on the right.
- Treating a binary-looking string such as
1010as decimal without noting its base. - Assuming leading zeros change the mathematical value.
- Calling a value signed without specifying its width and representation.
- Expecting every decimal fraction to have a finite binary expansion.
- Forgetting that a fixed-width result can overflow even when the mathematical result is valid.
Quick Reference
The binary number system becomes easier once you connect every rule to powers of two:
- Each step left doubles the place value.
- A 1 includes a place value and a 0 excludes it.
- bits create distinct patterns.
- Unsigned -bit values range from 0 to .
- Signed interpretation requires a width and a representation.
- Three-bit and four-bit groups map directly to octal and hexadecimal.
For a scan-friendly list, open the binary table from 0 to 100. Use it to compare place values, spot carry boundaries, and check conversions across binary, octal, decimal, and hexadecimal.
