How Binary, Decimal, and Hexadecimal Number Systems Actually Work in Computing
Demystify computer arithmetic: understand positional radix systems, how transistors translate voltage into 1s and 0s, and why developers love hexadecimal color codes.
Introduction: Positional Radix Systems
All number systems used in modern mathematics and computing are positional radix systems, where the value of each digit depends upon its position relative to the base:
$$\text{Value} = \sum_{i=0}^{n-1} d_i \times \text{Base}^i$$
The 4 Primary Computing Bases
- Decimal (Base 10): Uses digits
0–9. Built on human anatomy (10 fingers). - Binary (Base 2): Uses digits
0, 1. Powers physical CPU registers, memory buses, and logic gates. - Hexadecimal (Base 16): Uses digits
0–9and lettersA–F(where A=10, B=11, C=12, D=13, E=14, F=15). Widely used for memory addresses, CSS hex colors (#3B82F6), and MAC addresses. - Octal (Base 8): Uses digits
0–7. Commonly used in Unix file system permissions (e.g.,chmod 755).
Conversion Examples
Converting Decimal 42 to Binary (Repeated Division by 2):
42 ÷ 2 = 21remainder 021 ÷ 2 = 10remainder 110 ÷ 2 = 5remainder 05 ÷ 2 = 2remainder 12 ÷ 2 = 1remainder 01 ÷ 2 = 0remainder 1
Reading remainders bottom-to-top: `101010₂`
Converting Binary 101010₂ Back to Decimal:
$$\begin{aligned} & 1 \times 2^5 + 0 \times 2^4 + 1 \times 2^3 + 0 \times 2^2 + 1 \times 2^1 + 0 \times 2^0 \\ &= 32 + 0 + 8 + 0 + 2 + 0 = 42 \end{aligned}$$
Test synchronized 4-base conversions and toggle individual bits on our **Decimal & Binary Converter**.
Frequently Asked Questions
Published by AnantAstra's engineering and research desk. All calculations, privacy guarantees, and algorithms referenced in this article are open-source and run client-side in the browser.
Recommended Further Reading
Comprehensive FY 2025-26 salary tax analysis: understand the ₹75,000 standard deduction, the ₹7.75 Lakh tax-free threshold under 87A rebate, and the exact deduction breakeven point.
Read GuideUnderstand exact GST mathematical formulas: reverse-calculate original base prices from inclusive totals, add tax to net amounts, and accurately split CGST, SGST, and IGST.
Read GuideDemystify monthly loan repayments: uncover the reducing-balance EMI formula, how banks front-load interest in amortization schedules, and how small prepayments shave years off your tenure.
Read Guide