Number System Converter
Convert between binary, octal, decimal and hexadecimal instantly
Input
Number
From Base
Quick Reference — Decimal 0–15
Dec
Bin
Oct
Hex
0
0
0
0
1
1
1
1
2
10
2
2
3
11
3
3
4
100
4
4
5
101
5
5
6
110
6
6
7
111
7
7
8
1000
10
8
9
1001
11
9
10
1010
12
A
11
1011
13
B
12
1100
14
C
13
1101
15
D
14
1110
16
E
15
1111
17
F
Decimal (Base 10)
—
Enter a number above
Binary (Base 2)
—
Octal (Base 8)
—
Hexadecimal (Base 16)
—
Number Systems Explained
Different number systems use different bases — the number of unique digits available. The decimal system (base 10) uses digits 0–9. Binary (base 2) uses only 0 and 1. Octal (base 8) uses 0–7. Hexadecimal (base 16) uses 0–9 and A–F.
Computers work in binary at the hardware level — all data is ultimately stored as sequences of 0s and 1s. Hexadecimal is commonly used in programming because it's a compact way to represent binary values (each hex digit = 4 binary bits).
lightbulb Conversion Example
Convert decimal 255 to all bases:
1Binary: 255 = 11111111₂ (8 bits, all 1s)
2Octal: 255 = 377₈
3Hex: 255 = FF₁₆
✓ 0xFF is the maximum value of 1 byte (8 bits)
Where Each Base Is Used
- Binary (base 2): CPU logic, boolean operations, bit manipulation in programming, data storage at hardware level
- Octal (base 8): Unix/Linux file permissions (chmod 755 = rwxr-xr-x), older computing systems, assembly language
- Decimal (base 10): All everyday arithmetic and mathematics
- Hexadecimal (base 16): Memory addresses, color codes (#FF5733), MAC addresses, cryptographic hashes, Unicode code points
Key Terms
- Bit
- A single binary digit (0 or 1). The smallest unit of digital information.
- Byte
- 8 bits. Can represent values 0–255 in decimal (00–FF in hex, 000–377 in octal, 00000000–11111111 in binary).
- Nibble
- 4 bits = half a byte. Can represent 0–15 (0–F in hex). One hex digit represents exactly one nibble.
- Two's Complement
- The way computers represent negative numbers in binary. For a signed 8-bit integer, the range is −128 to +127 instead of 0 to 255.
quizFrequently Asked Questions
How do I convert binary to decimal manually?
Multiply each binary digit by the power of 2 corresponding to its position (starting from 0 on the right) and sum the results. Example: 1010₂ = (1×2³) + (0×2²) + (1×2¹) + (0×2⁰) = 8 + 0 + 2 + 0 = 10₁₀. For 11111111₂: (1×128) + (1×64) + (1×32) + (1×16) + (1×8) + (1×4) + (1×2) + (1×1) = 255. Each bit position doubles in value going left: 1, 2, 4, 8, 16, 32, 64, 128...
Why is hexadecimal used in programming and web colors?
Hexadecimal is a compact representation of binary. Since 16 = 2⁴, each hex digit represents exactly 4 binary bits (a nibble). A byte (8 bits) is represented by exactly 2 hex digits — much easier to read than 8 binary digits. Example: the binary string 11001111 becomes CF in hex. Web colors (#RRGGBB format) use 2 hex digits per color channel — #FF0000 = red (R=255, G=0, B=0). Memory addresses like 0x7FFF8000 are hex. Without hex, working with raw binary data would be impractical.
What does Unix permission 755 mean in binary?
Unix permissions use octal notation. 755 in octal = 7, 5, 5. Each digit represents 3 bits for Owner, Group, Others respectively. 7 (octal) = 111 in binary = read+write+execute (rwx). 5 (octal) = 101 in binary = read+execute (r-x). So chmod 755 = rwxr-xr-x: Owner can read, write, execute; Group and Others can read and execute but not write. 644 is common for files: 6=110=rw-, 4=100=r-- → Owner reads and writes, others only read.