Number Base Converter
Convert numbers between binary, octal, decimal, and hexadecimal instantly. Type in any field to see all other bases update in real time.
Common Values
About Number Base Converter
Computers use different number systems to represent and process data. While humans naturally use the decimal system (base 10) with digits 0 through 9, computers operate internally in binary (base 2) using only 0 and 1. Other bases like octal (base 8) and hexadecimal (base 16) serve as convenient shorthand for binary data, and understanding how to convert between them is a fundamental skill in computer science, programming, and electronics.
The decimal system (base 10) is the number system we use in everyday life. Each digit position represents a power of 10: units, tens, hundreds, and so on. The number 255 in decimal means 2×100 + 5×10 + 5×1.
The binary system (base 2) uses only two digits, 0 and 1, which map directly to the on/off states of transistors in digital circuits. Each position represents a power of 2: 1, 2, 4, 8, 16, 32, and so on. The decimal 255 in binary is 11111111, meaning all 8 bits are set — this is why 255 is the maximum value for a single byte and is commonly used as a subnet mask component (255.255.255.0).
The octal system (base 8) uses digits 0 through 7. It was historically used as a compact representation of binary because one octal digit corresponds exactly to three binary digits (bits). For example, binary 111 111 111 is octal 377, which equals decimal 255. Octal is still commonly used in Unix/Linux file permissions, where three octal digits represent the read, write, and execute permissions for owner, group, and others.
The hexadecimal system (base 16) uses digits 0–9 and letters A–F (or a–f) to represent values 10–15. One hexadecimal digit represents exactly four binary digits (a nibble), so two hex digits represent a full byte. This makes hexadecimal extremely convenient for representing binary data in a compact, human-readable form. Hex is widely used in programming for memory addresses, color codes (like #FF5733), byte values, and encoding.
Quick Conversion Reference
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 10 | 1010 | 12 | A |
| 16 | 10000 | 20 | 10 |
| 255 | 11111111 | 377 | FF |
| 1024 | 10000000000 | 2000 | 400 |
FAQ
Q: How do I convert binary to decimal?
To convert a binary number to decimal, multiply each bit by its positional power of 2, then sum the results. For example, binary 1101: (1×8) + (1×4) + (0×2) + (1×1) = 8 + 4 + 0 + 1 = 13. Our tool does this automatically — just type a binary number in the Binary field.
Q: Why is hexadecimal commonly used in programming?
Hexadecimal provides a compact representation of binary data because one hex digit maps exactly to 4 binary digits (bits), and two hex digits represent one byte. This makes it easy to read and write binary values without the length of full binary strings. Hex is used in memory addresses, color codes, byte values, and encoding formats.
Q: What is the largest number this converter can handle?
This converter uses JavaScript's built-in integer support, which safely handles integers up to 2^53 - 1 (9,007,199,254,740,991). For most practical programming and educational purposes, this is more than sufficient. Note that the 32-bit visual display only shows values up to 2^32 - 1 (4,294,967,295).
Q: How do I convert decimal to hexadecimal?
Divide the decimal number by 16 repeatedly, recording the remainders (0–15, where 10=A, 11=B, 12=C, 13=D, 14=E, 15=F). Read the remainders in reverse order to get the hex number. For example, 255 ÷ 16 = 15 remainder 15 (F), then 15 ÷ 16 = 0 remainder 15 (F), giving FF. Our tool converts instantly as you type.
Q: What are the common uses of octal numbers?
Octal (base 8) is primarily used in Unix/Linux file permissions, where three octal digits represent permissions for owner, group, and others. Each octal digit (0–7) maps to three binary bits representing read (4), write (2), and execute (1). For example, permission 755 means owner has all permissions (7=111), while group and others have read and execute (5=101).