How to Convert Number Bases (Binary, Octal, Hex): Examples

How to Convert Number Bases (Binary, Octal, Hex): Examples

Common bases: 2 (Binary), 8 (Octal), 10 (Decimal), and 16 (Hexadecimal). Converting between them is fundamental to computers and networking.

What Each Base Is

  • Base 2 (Binary): 0, 1 — computers
  • Base 8 (Octal): 0-7 — Linux file permissions
  • Base 10 (Decimal): 0-9 — everyday numbers
  • Base 16 (Hex): 0-9, A-F — web colors, MAC addresses

Decimal to Other Bases

Divide repeatedly by the base, collect remainders, read them bottom-up.

Example: 13 (decimal) → binary:

  • 13 ÷ 2 = 6 remainder 1
  • 6 ÷ 2 = 3 remainder 0
  • 3 ÷ 2 = 1 remainder 1
  • 1 ÷ 2 = 0 remainder 1

Read bottom-up: 1101

Other Bases to Decimal

Multiply each digit by base^position and add.

Example: 1101 (binary) = 1×8 + 1×4 + 0×2 + 1×1 = 13

Quick Chart

DecimalBinaryHex
000
111
101010A
151111F
25511111111FF

Where It Applies

  • Programming and system analysis
  • Linux permissions (chmod 755)
  • Colors and networking

Try the number base converter to convert instantly.