Blog
Custom Print on Demand Apparel — Free Storefront for Your Business
Wild & Free Tools

Number Systems Explained — Binary, Decimal, Hex & Octal for Beginners

Last updated: April 20268 min readConverter Tools

There are four number systems you will encounter in computing: binary (base-2), octal (base-8), decimal (base-10), and hexadecimal (base-16). They all represent the same values — just written differently. 255 in decimal = 11111111 in binary = FF in hex = 377 in octal.

If you have ever wondered why programmers write FF instead of 255, why Linux permissions use numbers like 755, or why computers "think" in 1s and 0s — this guide explains all four number systems from scratch. No math background required.

Master Conversion Table

This is the table you will keep coming back to. Key values shown in all four bases side by side:

DecimalBinaryHexOctal
0000
1111
711177
81000810
101010A12
151111F17
16100001020
31111111F37
321000002040
631111113F77
64100000040100
12711111117F177
1281000000080200
25511111111FF377
256100000000100400
51210000000002001000
1024100000000004002000
655351111111111111111FFFF177777

The Four Systems Compared

PropertyBinary (Base-2)Octal (Base-8)Decimal (Base-10)Hex (Base-16)
Digits used0, 10-70-90-9, A-F
Why it existsMatches transistor on/off statesGroups of 3 bits for permissionsHuman counting (10 fingers)Compact representation of binary
Common usesHardware, bitwise operations, flagsUnix file permissions (chmod)Everyday math, human-readable valuesColors, memory addresses, hashes
Bits per digit13~3.324
How to spot itStarts with 0b (programming)Starts with 0o (Python) or 0 (C)No prefix (default)Starts with 0x or # (colors)
Compactness✗ Very long~Moderate~Moderate✓ Most compact
Human readable✗ Hard to read~Moderate✓ Easiest~Takes practice

Binary — The Language of Computers

Binary is base-2 — it uses only two digits: 0 and 1. Every piece of data in every computer on Earth is ultimately stored in binary.

Why? Because computer hardware is built from transistors, and transistors are switches with two states: on (1) and off (0). There is no "sort of on." This two-state design makes circuits simpler, faster, and more reliable.

Binary is verbose — the number 255 requires 8 digits (11111111) instead of 3. That is why humans rarely work directly in binary. We use hex or decimal as a more readable shorthand.

Where you see binary:

Octal — The Unix File Permission System

Octal is base-8 — it uses digits 0 through 7. Each octal digit represents exactly 3 binary bits, which aligns perfectly with Unix file permission groups.

The command chmod 755 myfile uses three octal digits:

PermissionBinaryOctalMeaning
---0000No permissions
--x0011Execute only
-w-0102Write only
-wx0113Write + execute
r--1004Read only
r-x1015Read + execute
rw-1106Read + write
rwx1117Read + write + execute

This is why octal survives in modern computing — it is the perfect fit for the 3-bit permission model. Beyond file permissions, octal is rare in everyday programming.

Hexadecimal — The Developer's Shorthand

Hexadecimal is base-16 — it uses digits 0-9 plus letters A-F (where A=10, B=11, C=12, D=13, E=14, F=15). Each hex digit represents exactly 4 binary bits, which means one byte (8 bits) is always exactly 2 hex digits.

This 4-bit mapping is what makes hex so useful. Instead of writing the 32-bit binary number 11001010111111101011101011111110, you write CAFEBABE — 8 characters instead of 32. Same value, much easier to read, type, and remember.

Where you see hex everywhere:

How to Convert Between Any Two Bases

The simplest approach is the decimal bridge method: convert from the source base to decimal, then from decimal to the target base.

Step 1: Any Base to Decimal

Multiply each digit by the base raised to its position (starting at 0 from the right), then add them all together.

Example: Octal 377 to decimal

192 + 56 + 7 = 255

Step 2: Decimal to Any Base

Repeatedly divide by the target base and collect the remainders. Read remainders from bottom to top.

Example: Decimal 255 to hex

Reading bottom to top: FF

Shortcut: Binary to Hex (Direct)

Group binary digits into sets of 4 from the right. Convert each group to its hex digit. No decimal bridge needed.

Example: Binary 11001010 to hex

Result: CA

Shortcut: Binary to Octal (Direct)

Group binary digits into sets of 3 from the right. Convert each group to its octal digit.

Example: Binary 11111111 to octal

Result: 377

Real-World Uses at a Glance

Use CaseBase UsedWhy This BaseExample
CSS colorsHex2 digits per color channel, compact#FF5733
File permissionsOctal3 bits per permission groupchmod 755
IP addressesDecimal (stored in binary)Human-readable for network config192.168.1.1
Memory addressesHexCompact representation of 64-bit addresses0x7FFF5FBFF8A0
MAC addressesHex6 bytes displayed as 12 hex digitsAA:BB:CC:DD:EE:FF
Price tagsDecimalEveryday human readability$29.99
Subnet masksBinary / DecimalShows the exact bit boundary255.255.255.0 = /24
Hash valuesHexCompact display of large binary outputsd41d8cd98f00b204...
Unicode code pointsHexRange 0-10FFFF is cleaner in hexU+0041 = A
Bit flagsBinaryEach bit is a separate on/off flag10110 = features 1,2,4 on

Convert Between All Bases Instantly

Enter a number in any base — binary, octal, decimal, or hex — and see all conversions instantly.

Open Number Base Converter
Launch Your Own Clothing Brand — No Inventory, No Risk