Every time you send a text message, browse a website, or run an app, your device is silently crunching numbers in binary — a number system made up of just 0s and 1s. Understanding binary, decimal, and hexadecimal number systems is foundational knowledge for computer science, programming, networking, and digital electronics. This guide explains each system, teaches you how to convert between them, and shows you where a binary calculator can save you time and errors.
A number system's "base" (or "radix") tells you how many unique digits it uses. The position of each digit determines its value through powers of the base. This is called positional notation, and it's the principle behind all the number systems we'll discuss.
The decimal system is what humans use every day. It has ten digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. Each position represents a power of 10. The number 425 means 4 × 100 + 2 × 10 + 5 × 1 = 400 + 20 + 5.
Binary uses only two digits: 0 and 1. Each position represents a power of 2. The binary number 1101 means 1 × 8 + 1 × 4 + 0 × 2 + 1 × 1 = 13 in decimal. Binary is the native language of all digital computers because electronic circuits naturally have two states: on and off.
Hexadecimal (or "hex") uses sixteen digits: 0–9 and A–F (where A=10, B=11, C=12, D=13, E=14, F=15). Each position represents a power of 16. Hex is widely used as a compact, human-readable representation of binary data, since each hex digit corresponds exactly to 4 binary bits.
Converting from decimal to binary involves repeatedly dividing by 2 and recording the remainders.
Alternatively, find the largest power of 2 that fits in your number, subtract it, and place a 1 in that position. Continue with the remainder. For 42: the largest power of 2 ≤ 42 is 32 (2⁵). Place 1 in the 32s position. Remainder: 10. Next power: 8 (2³). Place 1 in the 8s position. Remainder: 2. Next power: 2 (2¹). Place 1 in the 2s position. Result: 101010.
Converting from binary to decimal is straightforward: multiply each digit by its corresponding power of 2 and add them up.
The process mirrors decimal-to-binary, but you divide by 16 instead of 2.
Multiply each hex digit by its corresponding power of 16 and sum them. Remember that A=10, B=11, C=12, D=13, E=14, F=15.
This is the easiest conversion because of the clean 4-to-1 relationship: every 4 binary digits map to exactly 1 hex digit.
Simply convert each hex digit to its 4-bit binary equivalent. This is often the fastest path when you need to convert between decimal and binary — go through hex as an intermediate step.
| Binary | Decimal | Hex |
|---|---|---|
| 0000 | 0 | 0 |
| 0001 | 1 | 1 |
| 0010 | 2 | 2 |
| 0011 | 3 | 3 |
| 0100 | 4 | 4 |
| 0101 | 5 | 5 |
| 0110 | 6 | 6 |
| 0111 | 7 | 7 |
| 1000 | 8 | 8 |
| 1001 | 9 | 9 |
| 1010 | 10 | A |
| 1011 | 11 | B |
| 1100 | 12 | C |
| 1101 | 13 | D |
| 1110 | 14 | E |
| 1111 | 15 | F |
Convert between binary, decimal, and hex instantly:
Free Binary Calculator →Just like decimal numbers, binary numbers can be added, subtracted, multiplied, and divided. Binary arithmetic follows the same principles but with only two digits.
There are four possible scenarios when adding two binary digits:
Binary subtraction uses borrowing, just like decimal subtraction:
Binary multiplication is simpler than decimal multiplication because you're only ever multiplying by 0 or 1. Any number times 0 is 0; any number times 1 is itself. Multiply each digit of one number by the other, shifting left for each position, then add the results.
At the hardware level, every operation a computer performs — from rendering graphics to processing text — is reduced to binary operations. Transistors act as switches that are either on (1) or off (0), and combinations of billions of these switches form the logic gates that power modern processors.
IPv4 addresses (like 192.168.1.1) are stored and processed as 32-bit binary numbers. Understanding binary is essential for subnetting — dividing a network into smaller segments. Subnet masks (255.255.255.0, for example) are binary patterns that determine which part of an IP address identifies the network and which identifies the host.
Web colors are expressed in hexadecimal. The color #8B5CF6 (the purple used on this page) represents 139 red, 92 green, and 246 blue in decimal. Each pair of hex digits controls one color channel, ranging from 00 (0) to FF (255). Understanding hex makes working with colors in web design, graphic design, and video editing much more intuitive.
File types are identified by "magic numbers" — specific byte sequences at the beginning of a file. PDF files start with 25 50 44 46 (hex) which spells "%PDF" in ASCII. JPEG files begin with FF D8 FF. Understanding hex lets you inspect and identify files at the binary level.
Every byte in a computer's memory has a unique address, typically expressed in hexadecimal. When you see addresses like 0x7FFE9A4B2C10 in debugging tools, that's a hex representation of a binary memory location. Hex is used because it's compact enough to read at a glance while maintaining a direct, clean mapping to binary.
| Unit | Size | Common Use |
|---|---|---|
| Bit | 1 binary digit | Smallest unit of data |
| Nibble | 4 bits | One hex digit |
| Byte | 8 bits | One character (ASCII) |
| Kilobyte (KB) | 1,024 bytes | Small text file |
| Megabyte (MB) | 1,024 KB | Photo, short video |
| Gigabyte (GB) | 1,024 MB | Movie, large app |
| Terabyte (TB) | 1,024 GB | Hard drive capacity |
Note that in computing, these prefixes use powers of 2 (1,024 = 2¹⁰) rather than the standard powers of 10 (1,000). This is why a "500 GB" hard drive shows up as about 465 GB in your operating system — the drive manufacturer uses decimal gigabytes while your computer uses binary gibibytes.
While understanding the manual conversion process is valuable for learning and interviews, a binary calculator is the practical choice for real work. Use one when:
Binary, decimal, and hexadecimal are three different lenses for viewing the same underlying numbers. Decimal is natural for humans, binary is native to computers, and hexadecimal bridges the gap as a compact, readable format. Whether you're studying computer science, configuring networks, designing web interfaces, or simply satisfying your curiosity, understanding these number systems — and having a reliable binary calculator at hand — is an essential skill.
Divide the decimal number by 2 repeatedly, recording the remainders. Read the remainders from bottom to top. For example, 25 ÷ 2 = 12 R1, 12 ÷ 2 = 6 R0, 6 ÷ 2 = 3 R0, 3 ÷ 2 = 1 R1, 1 ÷ 2 = 0 R1. Reading bottom to top: 11001.
Computers use binary because electronic circuits have two states: on (1) and off (0). This binary system maps naturally to transistors, which are the building blocks of all digital electronics. It's simpler and more reliable than trying to represent 10 different voltage levels.
Hexadecimal (base-16) is used as a human-readable shorthand for binary. Since each hex digit represents exactly 4 binary bits, it's perfect for representing memory addresses, color codes (like #FF5733), MAC addresses, and debugging data.
Group the binary digits into sets of 4 (starting from the right). Convert each 4-bit group to its hex equivalent: 0000=0, 0001=1, ..., 1010=A, 1111=F. For example, 10101100 → 1010 1100 → AC in hex.
Decimal (base-10) uses ten digits (0-9) and is what humans use daily. Binary (base-2) uses only two digits (0-1) and is what computers use internally. Every decimal number can be represented in binary and vice versa — they're just different ways of writing the same value.