Number Base Converter
Convert numbers between binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16).
Essential for programming and computer science.
Number Bases (Radix) A number base (or radix) determines how many unique digits are used to represent numbers. Decimal (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. Each position in a number represents a power of the base.
Binary (Base 2) The language of computers. Every piece of digital data is ultimately stored as binary. Each digit is called a bit. 8 bits make a byte. Binary 1010 = 1x8 + 0x4 + 1x2 + 0x1 = 10 in decimal. The binary system was formalized by Gottfried Wilhelm Leibniz in 1703 in Germany, though ancient systems existed in India and China.
Octal (Base 8) Used historically in computing because each octal digit represents exactly 3 binary digits. Unix/Linux file permissions use octal notation (e.g., chmod 755). Octal 17 = 1x8 + 7 = 15 decimal = 1111 binary.
Hexadecimal (Base 16) The most common non-decimal base in programming. Each hex digit represents exactly 4 binary digits (a nibble). This makes it easy to read binary data compactly. Hex FF = 255 decimal = 11111111 binary. Hex is used for memory addresses, color codes (#FF0000 = red), MAC addresses, and debugging.
Conversion Methods To convert FROM decimal: repeatedly divide by the target base and collect remainders. To convert TO decimal: multiply each digit by its positional power and sum. To convert between binary, octal, and hex: group binary digits (3 for octal, 4 for hex) and convert each group.
Common Values 255 = FF hex = 377 octal = 11111111 binary (max value of one byte). 256 = 100 hex = 400 octal (one byte + 1). 65535 = FFFF hex (max 16-bit unsigned). 2^32 = 4,294,967,296 (max 32-bit address space).