MB
Mustafa Bilgic
Published: 1 January 2025 | Updated: 20 February 2026
Number Base Converter
Enter a value in any base — the others update automatically.
Decimal (Base 10)
Binary (Base 2)
Hex (Base 16)
Octal (Base 8)
Conversion Table: 0–31
Quick reference for the first 32 values across all four number systems.
| Decimal | Binary | Hex | Octal | Decimal | Binary | Hex | Octal |
How the Binary Number System Works
Binary is a base-2 number system — it uses only two digits (0 and 1). Every position in a binary number represents a power of 2, doubling from right to left:
| Position | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| Power of 2 | 2⁷ | 2⁶ | 2⁵ | 2⁴ | 2³ | 2² | 2¹ | 2⁰ |
| Value | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
Example: Convert 10110101 to decimal
1×128 + 0×64 + 1×32 + 1×16 + 0×8 + 1×4 + 0×2 + 1×1
= 128 + 0 + 32 + 16 + 0 + 4 + 0 + 1 = 181
Converting Decimal to Binary: Divide by 2 Method
Repeatedly divide by 2 and collect the remainders. Read from bottom to top:
Example: Convert 45 to binary
45 ÷ 2 = 22 remainder 1
22 ÷ 2 = 11 remainder 0
11 ÷ 2 = 5 remainder 1
5 ÷ 2 = 2 remainder 1
2 ÷ 2 = 1 remainder 0
1 ÷ 2 = 0 remainder 1
Reading upward: 101101
Why Do Computers Use Binary?
Modern computers are built from billions of transistors — tiny electronic switches that are either ON (conducting electricity) or OFF (not conducting). These two states map perfectly to binary digits:
- 1 = ON (high voltage, transistor conducting)
- 0 = OFF (low voltage, transistor not conducting)
Binary is also highly noise-resistant. In a circuit, a signal can vary slightly due to electrical interference. With only two valid states (high/low voltage), the computer can reliably distinguish 0 from 1 even with noise. A decimal system (requiring 10 distinguishable voltage levels) would be far more error-prone.
All of the complex software, images, music, and videos on your computer are ultimately stored and processed as sequences of 0s and 1s.
Bits, Bytes, and Data Units
| Unit | Size | Binary Max | Decimal Max |
| 1 bit | 1 binary digit | 1 | 1 |
| 1 nibble | 4 bits | 1111 | 15 |
| 1 byte | 8 bits | 11111111 | 255 |
| 1 kilobyte (KB) | 1,024 bytes | 1,048,576 possible values |
| 1 megabyte (MB) | 1,024 KB | ~1.05 million bytes |
| 1 gigabyte (GB) | 1,024 MB | ~1.07 billion bytes |
| 1 terabyte (TB) | 1,024 GB | ~1.1 trillion bytes |
Note: Hard drive manufacturers often use SI prefixes (1 KB = 1,000 bytes), which is why a "500 GB" drive shows as ~465 GB in Windows.
ASCII Text Encoding
ASCII (American Standard Code for Information Interchange) assigns a number to each character, which is stored in binary. Every character you type is ultimately a binary number in memory:
| Character | Decimal | Binary | Hex |
| A | 65 | 01000001 | 41 |
| B | 66 | 01000010 | 42 |
| Z | 90 | 01011010 | 5A |
| a | 97 | 01100001 | 61 |
| z | 122 | 01111010 | 7A |
| 0 | 48 | 00110000 | 30 |
| Space | 32 | 00100000 | 20 |
The word "Hello" in ASCII binary: 01001000 01100101 01101100 01101100 01101111
IP Addresses in Binary
An IPv4 address consists of four octets (8-bit groups) separated by dots. Enter any IPv4 address to see its binary representation:
Frequently Asked Questions
How do you convert binary to decimal?
Write each binary digit and multiply by 2 raised to its position (rightmost position is 0). Sum all results. For 1011: (1×2³)+(0×2²)+(1×2¹)+(1×2⁰) = 8+0+2+1 = 11. Our calculator shows every step of this process automatically.
How do you convert decimal to binary?
Repeatedly divide by 2 and collect remainders. Example for 13: 13÷2=6 R1, 6÷2=3 R0, 3÷2=1 R1, 1÷2=0 R1. Reading remainders upward: 1101. Verify: 8+4+0+1=13. The calculator also shows each division step.
Why do computers use binary?
Computer processors are built from transistors — electronic switches with two states: ON (1) and OFF (0). Binary maps naturally to these two states. This makes binary circuits reliable and simple. All data — text, images, video — is ultimately stored as sequences of 0s and 1s.
What is a byte?
A byte is 8 bits. It can represent 256 different values (0 to 255 in decimal, 00000000 to 11111111 in binary). One byte is enough to store a single ASCII character. Modern storage is measured in kilobytes (1,024 bytes), megabytes (1,024 KB), gigabytes, and terabytes.
How do you read an IP address in binary?
An IPv4 address has four octets. Convert each to 8-bit binary. 192.168.1.1 becomes 11000000.10101000.00000001.00000001. Network engineers use binary to understand subnets — the subnet mask 255.255.255.0 in binary (11111111.11111111.11111111.00000000) shows which bits identify the network versus the host.
What is ASCII encoding?
ASCII maps 128 characters (letters, digits, punctuation, control codes) to numbers 0–127, stored in 7-bit binary. 'A'=65=1000001, 'a'=97=1100001. The difference of 32 (00100000) between uppercase and lowercase letters means you can toggle case by flipping one bit. Unicode extends this to over 1 million characters.