Number Base Converter: Binary, Octal, Decimal, and Hexadecimal
Convert between number bases including binary, octal, decimal, and hexadecimal. Learn how number systems work and their applications in programming.
February 14, 2026
Understanding Number Systems
Every number we use daily is expressed in a specific number base, or radix. While we naturally think in decimal (base 10), computers operate in binary (base 2), and programmers frequently work with octal (base 8) and hexadecimal (base 16). Our Number Base Converter lets you instantly translate values between these systems.
The Four Major Number Bases
Binary (Base 2)
Binary is the language of computers. Every piece of data in a computer is ultimately represented as sequences of 0s and 1s. Each digit is called a bit, and eight bits form a byte. For example, the decimal number 42 is 101010 in binary. Understanding binary is fundamental to computer science, as it underpins how processors execute instructions, how memory stores data, and how networks transmit information.
Octal (Base 8)
Octal uses digits from 0 to 7. It was historically popular in computing because each octal digit maps neatly to three binary digits. For example, the binary number 101010 converts to octal 52. Today, octal is most commonly encountered in Unix and Linux file permissions, where values like 755 or 644 control read, write, and execute access.
Decimal (Base 10)
Decimal is the number system humans use every day, with digits from 0 to 9. It likely evolved because we have ten fingers. While decimal is natural for human calculations, it is not particularly efficient for computers, which is why programmers often need to convert between decimal and other bases.
Hexadecimal (Base 16)
Hexadecimal extends beyond 0-9 by using letters A through F to represent values 10 through 15. This means each hex digit represents exactly four binary digits (a nibble). The decimal number 255 becomes FF in hexadecimal. Hex is ubiquitous in programming for representing colors (#FF5733), memory addresses (0x7FFF), MAC addresses, and byte values.
How Number Base Conversion Works
Converting between bases involves understanding positional notation. In any base, each digit's value is multiplied by the base raised to the power of its position. For example, in decimal, 42 means 4 times 10 to the first power plus 2 times 10 to the zeroth power. In binary, 101010 means 1 times 32, plus 0 times 16, plus 1 times 8, plus 0 times 4, plus 1 times 2, plus 0 times 1, which equals 42.
Use Cases in Programming
- Memory Debugging: Memory addresses and hex dumps display data in hexadecimal, making it essential to convert to and from hex when debugging low-level code.
- Bitwise Operations: Understanding binary is critical for bitwise AND, OR, XOR, and shift operations used in flags, masks, and performance optimization.
- File Permissions: Unix permissions use octal notation. Converting between octal and the underlying binary permission bits helps system administrators set precise access controls.
- Color Codes: Web developers convert between hex color codes and their RGB decimal equivalents when working with design specifications.
- Network Protocols: IP addresses, subnet masks, and MAC addresses are often expressed in binary, decimal, or hexadecimal depending on the context.
- Embedded Systems: Microcontroller programming requires frequent conversion between binary register values and hex or decimal representations.
How to Use the Number Base Converter
Enter a number in any supported base and instantly see its representation in all other bases. Select the input base, type your value, and the converter displays binary, octal, decimal, and hexadecimal equivalents simultaneously. It handles both integers and large numbers accurately.
Common Conversion Examples
Here are a few frequently needed conversions: decimal 255 equals hex FF and binary 11111111. Decimal 128 equals hex 80 and binary 10000000. Decimal 16 equals hex 10 and binary 10000. These patterns are especially useful when working with byte boundaries and powers of two.