Computers store, process, and transmit all data as binary digits (0 and 1). However, humans express numbers in decimal (Base-10), while software engineers frequently read memory addresses, color values, and network masks in hexadecimal (Base-16).
Understanding number base conversions and positional positional notation is essential for low-level programming, web color manipulation, bitwise logic, and networking subnets.
This guide explains positional math, manual conversion algorithms, bitwise arithmetic, and online conversion tools.
Positional Number Systems Overview
| Base Name | Radix | Digits / Symbols | Example (Value 42) |
| :--- | :--- | :--- | :--- |
| Binary | Base-2 | 0, 1 | 101010₂ |
| Octal | Base-8 | 0, 1, 2, 3, 4, 5, 6, 7 | 52₈ |
| Decimal | Base-10 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 | 42₁₀ |
| Hexadecimal | Base-16 | 0-9 and A-F (A=10 ... F=15) | 2A₁₆ |
1. Converting Binary to Decimal (Base-2 -> Base-10)
To convert binary to decimal, multiply each bit by $2^n$, where $n$ is the 0-indexed bit position from right to left:
Example: Convert 1101₂ to Decimal
$$\text = (1 \times 2^3) + (1 \times 2^2) + (0 \times 2^1) + (1 \times 2^0)$$ $$\text = 8 + 4 + 0 + 1 = 13_$$
2. Converting Decimal to Binary (Base-10 -> Base-2)
Repeatedly divide the decimal number by 2 and record the remainders from bottom to top.
Example: Convert 25₁₀ to Binary
- $25 \div 2 = 12$, remainder 1 (LSB)
- $12 \div 2 = 6$, remainder 0
- $6 \div 2 = 3$, remainder 0
- $3 \div 2 = 1$, remainder 1
- $1 \div 2 = 0$, remainder 1 (MSB)
Reading remainders backwards yields 11001₂.
Fast Online Base Converters
Convert binary strings, decimal integers, and hexadecimal addresses instantly with the free browser converters at ToolzStack: