Programming Concepts Tutorial

Learn the fundamental concepts of computer programming

Binary Numbers

Binary Number System

Humans use the Decimal (Base-10) system, counting with 10 digits (0-9).

Computers use the Binary (Base-2) system, counting with only 2 digits (0 and 1).

How Binary Works

In decimal, each position is a power of 10 (1s, 10s, 100s). In binary, each position is a power of 2 (1s, 2s, 4s, 8s, 16s).

Example: Binary 101 = (1 × 4) + (0 × 2) + (1 × 1) = 5 in decimal.

Try It Yourself

Edit the code below and click Run to see the result live.

Source Code
Result
Topics