How to Convert Binary Numbers
Binary (base-2) is the native language of every computer, router, and digital device on the planet. Every file you open, every pixel on your screen, and every character you type is ultimately stored as a sequence of 0s and 1s called bits. Understanding how to convert binary is the first step to understanding how computers think — and it takes less effort than you might expect. This guide walks through three conversion paths (binary → decimal, binary → octal, binary → hexadecimal) with multiple worked examples and step-by-step verification for each.
How Binary Positional Notation Works
Every number system is built on the same principle: each digit position represents a power of the base. In base-10 (decimal), the positions represent 1, 10, 100, 1000 — powers of 10. In base-2 (binary), the positions represent 1, 2, 4, 8, 16, 32, 64, 128 — powers of 2. The rightmost bit is always position 0, and each step to the left doubles the value. A bit that is 1 contributes its full positional value; a bit that is 0 contributes nothing.
| Bit position | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|
| Power of 2 | 2⁷ | 2⁶ | 2⁵ | 2⁴ | 2³ | 2² | 2¹ | 2⁰ |
| Decimal value | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
Binary → Decimal: The Method
- Write the binary number and label each bit's position from 0 (rightmost) increasing to the left.
- Look up or calculate the positional value: 2^position (1, 2, 4, 8, 16, …).
- For every bit that is 1, note its positional value. Bits that are 0 contribute nothing.
- Add all the noted positional values together — that sum is the decimal equivalent.
Worked Example 1 — Convert (1011)₂ to Decimal
Label each bit with its position (right = 0) and its positional value:
| Bit | 1 | 0 | 1 | 1 |
|---|---|---|---|---|
| Position | 3 | 2 | 1 | 0 |
| Positional value | 8 | 4 | 2 | 1 |
| Contributes | 8 | 0 | 2 | 1 |
Worked Example 2 — Convert (11101001)₂ to Decimal
An 8-bit number. Identify the 1-bits at positions 7, 6, 5, 3, and 0 and sum their values:
| Bit | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 1 |
|---|---|---|---|---|---|---|---|---|
| Position | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| Positional value | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
| Contributes | 128 | 64 | 32 | 0 | 8 | 0 | 0 | 1 |
Binary → Octal: The 3-Bit Grouping Shortcut
The mathematical relationship 2³ = 8 makes binary and octal perfect partners. Every group of exactly 3 binary bits produces one octal digit (0–7). Because there are only 8 possible 3-bit patterns — from 000 to 111 — the mapping is simply a lookup table. No arithmetic is needed; just split and substitute.
| 3-bit binary | Octal | 3-bit binary | Octal |
|---|---|---|---|
| 000 | 0 | 100 | 4 |
| 001 | 1 | 101 | 5 |
| 010 | 2 | 110 | 6 |
| 011 | 3 | 111 | 7 |
- Start from the rightmost bit and group into chunks of 3 moving left.
- If the leftmost group has fewer than 3 bits, pad it with leading zeros on the left.
- Replace each 3-bit group with its octal digit from the table above.
Worked Example — Convert (101101)₂ to Octal
Six bits divide evenly into two groups of 3 — no padding needed.
| 3-bit group | 101 | 101 |
|---|---|---|
| Octal digit | 5 | 5 |
Worked Example — Convert (11101001)₂ to Octal
Eight bits: group from right in sets of 3. 8 is not a multiple of 3, so pad the leftmost group: 011 | 101 | 001.
| 3-bit group | 011 | 101 | 001 |
|---|---|---|---|
| Octal digit | 3 | 5 | 1 |
Binary → Hexadecimal: The 4-Bit Grouping Shortcut
Similarly, 2⁴ = 16, so every group of 4 binary bits maps to exactly one hex digit (0–9, A–F). Hexadecimal is more compact than octal — one byte (8 bits) is always exactly 2 hex digits, which is why hex dominates in computing: memory addresses, color codes (#RRGGBB), and cryptographic hashes all use hex.
| 4-bit binary | Hex | Decimal | 4-bit binary | Hex | Decimal |
|---|---|---|---|---|---|
| 0000 | 0 | 0 | 1000 | 8 | 8 |
| 0001 | 1 | 1 | 1001 | 9 | 9 |
| 0010 | 2 | 2 | 1010 | A | 10 |
| 0011 | 3 | 3 | 1011 | B | 11 |
| 0100 | 4 | 4 | 1100 | C | 12 |
| 0101 | 5 | 5 | 1101 | D | 13 |
| 0110 | 6 | 6 | 1110 | E | 14 |
| 0111 | 7 | 7 | 1111 | F | 15 |
- Start from the rightmost bit and group into chunks of 4 moving left.
- Pad the leftmost group with leading zeros if it has fewer than 4 bits.
- Replace each 4-bit group with its hex digit from the table above.
Worked Example — Convert (11101111)₂ to Hexadecimal
Eight bits split into two groups of 4 from right to left.
| 4-bit group | 1110 | 1111 |
|---|---|---|
| Decimal value | 14 | 15 |
| Hex digit | E | F |
Worked Example — Convert (11101001)₂ to Hexadecimal
Continuing from Example 2 (233₁₀): group the 8 bits into two 4-bit chunks.
| 4-bit group | 1110 | 1001 |
|---|---|---|
| Decimal value | 14 | 9 |
| Hex digit | E | 9 |
When to Use Each Method
| Conversion | Method | Speed | Notes |
|---|---|---|---|
| Binary → Decimal | Positional notation (sum powers of 2) | Moderate | Always works; unavoidable for decimal output |
| Binary → Octal | 3-bit grouping | Very fast | No arithmetic — pure lookup; best shortcut |
| Binary → Hex | 4-bit grouping | Very fast | No arithmetic — pure lookup; industry standard |
- Binary Converter — Convert binary numbers to decimal, octal, and hex instantly
- Binary Conversion Formula — Positional notation formula with variable definitions and examples
Frequently Asked Questions
Why does every binary number end in 0 if it is even, or 1 if it is odd?
The rightmost bit represents 2⁰ = 1. If that bit is 1, the number is odd (the other bits all contribute even values — powers of 2 greater than 0). If that bit is 0, the total is a sum of even numbers and therefore even. This is the binary equivalent of checking whether a decimal number ends in an odd or even digit.
What is the difference between binary and two's complement?
Standard (unsigned) binary represents only non-negative integers. Two's complement is an encoding for signed integers: the most significant bit is given a negative weight (−2^(n−1)), allowing representation of negative numbers without any special cases for addition and subtraction. Most modern processors use two's complement internally for all integer arithmetic.
Can binary represent fractions?
Yes — binary fractions use negative powers of 2 after a binary point. For example, 0.1₂ = 2⁻¹ = 0.5₁₀, and 0.011₂ = 2⁻² + 2⁻³ = 0.25 + 0.125 = 0.375₁₀. However, many decimal fractions (like 0.1) cannot be represented exactly in binary — this is the root cause of floating-point rounding errors in computers.
How do I quickly estimate the decimal value of a binary number?
Find the leftmost 1-bit and note its positional value — that tells you the order of magnitude. For example, if the leftmost bit is at position 6 (value 64), the number is between 64 and 127. Then add the remaining 1-bits to narrow it down. For a rough estimate, just use the leftmost bit's value.