Number Base Converter
Convert numbers between Binary, Octal, Decimal, and Hexadecimal systems instantly.
Base Converter
Convert between Decimal, Binary, Hex and Octal in real time.
Understanding Number Systems
We use the decimal system (Base-10) in everyday life, likely because we have 10 fingers. However, computers operate using switches that are either ON or OFF, necessitating the binary system (Base-2).
Bridging the gap between human-readable numbers and machine code requires understanding and converting between these different systems.
Supported Bases Explained
Binary (Base-2)
Digits: 0, 1
The fundamental language of computers. Everything from your photos to this text is stored as a sequence of 0s and 1s.
Decimal (Base-10)
Digits: 0-9
The standard system for human arithmetic. Each position represents a power of 10 (1s, 10s, 100s, etc.).
Octal (Base-8)
Digits: 0-7
Less common today but historically important in early computing (like PDP-8). Used in Unix file permissions (e.g., chmod 755).
Hexadecimal (Base-16)
Digits: 0-9, A-F
The standard for representing binary data compactly. Used in color codes (#FF5733), memory addresses, and MAC addresses.
Conversion Examples
| Decimal | Binary | Hexadecimal | Octal |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 |
| 10 | 1010 | A | 12 |
| 15 | 1111 | F | 17 |
| 16 | 10000 | 10 | 20 |
| 255 | 11111111 | FF | 377 |
Why Hexadecimal?
You might wonder why we use letters in math. Hexadecimal is incredibly useful because it maps perfectly to bytes.
- 1 Byte = 8 Bits (e.g., 11111111)
- 1 Hex Digit = 4 Bits (e.g., F = 1111)
- Therefore, 2 Hex Digits = 1 Byte exactly.
This makes Hex the perfect shorthand for binary. Writing FF is much easier and less error-prone than writing 11111111.
Frequently Asked Questions
What is a number base? ▼
A number base (or radix) determines how many unique digits are available to represent numbers. In Base-10 (Decimal), we have 10 digits (0-9). When we count past 9, we add a new position (10). In Base-2 (Binary), we only have 2 digits (0-1). When we count past 1, we add a new position (10, which equals 2 in decimal).
How do I convert Binary to Decimal manually? ▼
Multiply each digit by 2 raised to the power of its position (starting from 0 on the right).
Example: 101
(1 × 2²) + (0 × 2¹) + (1 × 2⁰)
(1 × 4) + (0 × 2) + (1 × 1)
4 + 0 + 1 = 5
Why do programmers confuse Halloween and Christmas? ▼
Because Octal 31 equals Decimal 25!
OCT 31 = (3 × 8¹) + (1 × 8⁰) = 24 + 1 = DEC 25.
What is the largest number I can convert? ▼
Our tool uses JavaScript's BigInt feature, which supports integers of arbitrary length. You are limited only by your
computer's memory. You can easily convert numbers with hundreds or thousands of digits.