Digital Systems Guide

Binary, Hexadecimal and Octal Explained — Number Systems Guide

6 min read · Unitafy Guides

While humans use the decimal (base-10) number system, computers operate in binary (base-2). Hexadecimal and octal are also widely used in programming and computing. This guide explains all three clearly.

Why Do Computers Use Binary?

Computers use binary because electronic circuits have exactly two states: on (1) and off (0). Binary maps directly to these physical states, making it the most reliable and efficient system for digital electronics.

Binary (Base-2)

Binary uses only 0 and 1. Each position represents a power of 2:

Binary 1011 = 1×8 + 0×4 + 1×2 + 1×1 = 11 (decimal)

Hexadecimal (Base-16)

Hex uses digits 0–9 and A–F (where A=10, B=11, C=12, D=13, E=14, F=15). It is commonly used for colour codes, memory addresses, and representing large binary numbers compactly.

#FF5733 (web colour) = Red: FF (255), Green: 57 (87), Blue: 33 (51)

Octal (Base-8)

Octal uses digits 0–7. It was historically used in computing but is less common today. It is still used in Unix file permissions.

Conversion Table

DecimalBinaryHexadecimalOctal
0000000
5010155
101010A12
151111F17
16100001020
25511111111FF377

How to Convert Decimal to Binary

Repeatedly divide by 2 and record the remainders:

13 ÷ 2 = 6 R 1
6 ÷ 2 = 3 R 0
3 ÷ 2 = 1 R 1
1 ÷ 2 = 0 R 1
Read remainders bottom to top: 1101

Real-World Uses

Try the Binary Converter

Use our free converter — no signup, no ads, works instantly.

Open Converter →