Number Base Converter: The Complete Guide to Binary, Decimal, Octal & Hexadecimal

Every number you see on a screen is ultimately represented in binary — ones and zeros — at the hardware level. But humans work with different number systems depending on the context: decimal for everyday math, hexadecimal for programming, octal for file permissions, and binary for understanding how computers actually work.

A number base converter lets you translate between these systems instantly. This guide explains how each number system works, how to convert between them, and where you'll encounter them in real life.

🔄 Free Number Base Converter

Understanding Number Bases (Radix)

A number base defines how many unique symbols are used to represent values and how place values work. In decimal (base-10), each position represents a power of 10. In binary (base-2), each position represents a power of 2.

The four most common number systems in computing are:

SystemBaseDigitsCommon Use
Binary20, 1Computer architecture, networking
Octal80-7Unix file permissions, legacy systems
Decimal100-9Everyday arithmetic
Hexadecimal160-9, A-FProgramming, web colors, memory

How Number Bases Work

Let's see how the number 255 is represented in each base:

All four represent the same value — 255 — just using different bases. The number base converter handles these translations instantly.

Conversion Methods

Decimal to Binary

Repeatedly divide by 2, recording remainders from bottom to top:

42 ÷ 2 = 21 remainder 0
21 ÷ 2 = 10 remainder 1
10 ÷ 2 = 5  remainder 0
 5 ÷ 2 = 2  remainder 1
 2 ÷ 2 = 1  remainder 0
 1 ÷ 2 = 0  remainder 1
Result: 101010

Binary to Decimal

Multiply each digit by 2 to the power of its position (starting from 0 on the right):

101010 = 1×32 + 0×16 + 1×8 + 0×4 + 1×2 + 0×1
       = 32 + 8 + 2 = 42

Decimal to Hexadecimal

Same method as binary, but divide by 16:

255 ÷ 16 = 15 remainder 15 (F)
 15 ÷ 16 = 0  remainder 15 (F)
Result: FF

Decimal to Octal

Divide by 8 and collect remainders:

255 ÷ 8 = 31 remainder 7
 31 ÷ 8 = 3  remainder 7
  3 ÷ 8 = 0  remainder 3
Result: 377

Binary to Hex (and Vice Versa)

Group binary digits into sets of 4 (from the right), then convert each group to its hex equivalent:

Binary:  1101  0111  1010
         D     7     A
Result: 0xD7A

Real-World Applications

Binary — The Foundation of Computing

Every piece of data in a computer — text, images, videos, programs — is stored as binary. Subnet masks in networking (like 255.255.255.0 or /24) are based on binary bit patterns. Understanding binary is essential for anyone working with computers at a low level.

Hexadecimal — The Programmer's Shortcut

Since each hex digit maps to exactly 4 binary bits, hexadecimal is the most practical way to represent binary data. Uses include:

Octal — Unix Permissions

The most common everyday use of octal is Unix/Linux file permissions. When you run chmod 755 file.sh, the 755 is octal: 7 (rwx) for owner, 5 (r-x) for group, 5 (r-x) for others. Each digit is a 3-bit binary representation of read (4), write (2), and execute (1) permissions.

Beyond the Common Bases

While binary, octal, decimal, and hex are the most common, other bases appear in specialized contexts:

Tips for Learning Number Base Conversion

  1. Start with binary-to-decimal: This is the most fundamental conversion. Master it before moving to other bases.
  2. Memorize powers of 2: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024. These come up constantly.
  3. Use the grouping trick: Binary → Hex (groups of 4), Binary → Octal (groups of 3). No math required.
  4. Practice with the converter tool: Verify your manual calculations.
  5. Learn hex colors: If you do any web work, CSS hex colors are a great way to build intuition.

Related Tools

Frequently Asked Questions

What is a number base?
A number base (or radix) is the number of unique digits used to represent numbers. Decimal is base-10 (digits 0-9), binary is base-2 (digits 0-1), octal is base-8 (digits 0-7), and hexadecimal is base-16 (digits 0-9 and A-F).
How do I convert binary to decimal?
Multiply each binary digit by 2 raised to its position (starting from 0 on the right), then sum the results. For example, binary 1011 = 1×8 + 0×4 + 1×2 + 1×1 = 11 in decimal.
Why do computers use binary?
Computers use binary because electronic circuits have two states: on (1) and off (0). This binary system maps naturally to transistors and logic gates, making it the most reliable way to represent and process data in hardware.
What is the difference between base-8 and base-16?
Octal (base-8) uses digits 0-7 and each digit represents 3 bits. Hexadecimal (base-16) uses digits 0-9 and A-F, with each digit representing 4 bits. Hex is more commonly used today because modern computers are byte-oriented (8 bits = 2 hex digits).
How do you convert decimal to binary?
Divide the decimal number by 2 repeatedly, recording each remainder. The remainders read in reverse order give you the binary equivalent. For example: 13 ÷ 2 = 6 remainder 1, 6 ÷ 2 = 3 remainder 0, 3 ÷ 2 = 1 remainder 1, 1 ÷ 2 = 0 remainder 1. Reading remainders in reverse: 1101.
🔄 Convert Number Bases Now