Number Base Converter
Convert numbers between binary, decimal, octal, and hexadecimal instantly. Free online number base converter for programmers, students, and electronics engineers.
Free Number Base Converter — Binary, Decimal, Octal, and Hexadecimal
Computers are fundamentally binary machines — every calculation, every data value, every instruction that runs on a processor is ultimately expressed as a sequence of zeros and ones. Yet humans prefer working with decimal numbers, and programmers frequently use hexadecimal as a compact representation of binary data. Understanding how the same value appears across these different bases — and being able to convert between them quickly and accurately — is a foundational skill for software developers, computer science students, electronics engineers, and anyone working with low-level systems programming, digital electronics, or network protocols. Our free online number base converter handles instant, accurate conversion between binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16).
Understanding Number Bases — Why Different Bases Exist
A number base (or radix) defines how many distinct digit symbols are used to represent numbers, and consequently the positional weight of each digit. In base 10 (decimal), the system humans use for everyday arithmetic, there are ten digits (0-9) and each position in a number represents a power of ten: the rightmost digit is the ones place (10⁰), the next is the tens place (10¹), then hundreds (10²), thousands (10³), and so on.
In base 2 (binary), there are only two digits (0 and 1), and each position represents a power of two: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, and so on. This directly mirrors the physical reality of digital electronics, where each logical gate or memory cell has exactly two stable states — on (1) or off (0). Every number that can be expressed in decimal can also be expressed in binary; the representation is just longer. The decimal number 255, for example, is 11111111 in binary — eight 1s, representing 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1.
In base 16 (hexadecimal), there are sixteen digits: the standard digits 0-9 plus the letters A through F to represent the values ten through fifteen. The motivation for this seemingly odd base is its perfect correspondence to binary: each single hexadecimal digit represents exactly four binary digits (bits). This means a byte (8 bits) can always be represented by exactly two hex digits, making hexadecimal an extremely compact and readable way to express binary data. The byte value 11111111 in binary is FF in hexadecimal — the same information in two characters rather than eight.
Binary — The Language of Digital Hardware
Binary representation is not just a human convention for discussing digital systems — it is the actual physical implementation of information in digital hardware. Transistors operate as binary switches: when sufficient voltage is applied to a MOSFET gate, current flows (logic 1); when voltage is removed, current stops (logic 0). A CPU register containing billions of such transistors stores billions of binary digits simultaneously. All arithmetic, all data manipulation, all program execution happens through the application of boolean logic (AND, OR, NOT, XOR gates) to these binary values.
In binary arithmetic, addition follows different rules than decimal but with the same underlying logic. 1 + 1 in binary equals 10 (not ten — read as "one-zero" in binary, representing the decimal value two). The "carry" from this addition is identical in principle to carrying in decimal addition, just triggering after a sum of 2 rather than 10. Understanding binary arithmetic is essential for computer architecture courses, assembly language programming, digital logic design, and embedded systems development.
Binary is also the foundation for understanding data storage and transmission at the fundamental level. A single bit is the smallest unit of digital information. Eight bits make a byte. File sizes, memory capacities, and network bandwidths are all ultimately expressed in multiples of bytes — which are multiples of eight bits. Knowing how to read and convert binary values to decimal and hex allows developers to interpret raw memory dumps, packet captures, and hardware register values that are otherwise opaque sequences of zeros and ones.
Hexadecimal — The Programmer's Shorthand for Binary
Hexadecimal is the workhorse representation of the working programmer and system engineer. It appears in color codes (#FF6B35 in CSS), memory addresses (0x7FFF5FBFF8A8 in a debugger), machine code instruction sequences, network protocol fields, encryption keys, hash values, IPv6 addresses, and file format magic numbers. Understanding hexadecimal is essentially mandatory for anyone who regularly touches a debugger, reads technical specifications, works with binary file formats, or does any low-level programming.
The sixteen hex digits and their decimal and binary equivalents are worth memorizing. 0-9 represent the same values as their decimal counterparts. A = 10 (1010 in binary). B = 11 (1011). C = 12 (1100). D = 13 (1101). E = 14 (1110). F = 15 (1111). Each hex digit is therefore exactly a 4-bit nibble, and two hex digits (00 to FF) represent exactly one byte with values from 0 to 255 (decimal) or 00000000 to 11111111 (binary).
Color representation in web design uses 24-bit RGB color expressed as three pairs of hex digits: the first pair is the red channel (00 to FF), the second pair is green, the third is blue. #FF0000 is pure red (255, 0, 0 in decimal RGB). #00FF00 is pure green. #0000FF is pure blue. #FFFFFF is white (255, 255, 255). #000000 is black (0, 0, 0). Once you understand hex-to-decimal conversion for pairs of digits, reading color codes becomes immediate.
Octal — File Permissions and Legacy Systems
Octal (base 8) was used extensively in early computing, particularly with architectures like the PDP-8 where 12-bit words divided naturally into four 3-bit groups, each representable as a single octal digit. While octal is largely obsolete in modern computing contexts, it survives prominently in one specific and important area: Unix and Linux file permissions.
In Unix-like operating systems, file and directory permissions are expressed as a three-digit octal number when using the chmod command. Each octal digit represents the permissions for one of three categories: owner, group, and others. Within each digit, the three bits (since each octal digit = 3 binary bits) represent read permission (4), write permission (2), and execute permission (1). These values are added together: read+write+execute = 4+2+1 = 7 (rwx in symbolic notation), read+execute = 4+1 = 5 (r-x), read-only = 4 (r--).
So chmod 755 sets permissions where the owner has read+write+execute (7), the group has read+execute (5), and others have read+execute (5). chmod 644 gives the owner read+write (6) and everyone else read-only (4). Understanding the octal-to-binary-to-permission mapping makes Unix permission management intuitive. Our number base converter makes it easy to verify these octal values by converting them to binary and confirming the bit pattern corresponds to the intended permission structure.
Practical Number Base Conversion in Development Workflows
Debugging is the most frequent context where developers need rapid number base conversion. A debugger might display a variable's value in hexadecimal (0x1A) and you need to know the decimal equivalent (26) to understand whether the value makes sense in context. A network packet trace shows a field value in hex and you need the decimal equivalent to compare against a protocol specification that uses decimal. A hardware datasheet describes a register value in binary and you need the hex equivalent to construct the write command correctly.
Our converter handles all of these scenarios without requiring you to open a calculator, remember conversion formulas, or mentally execute multi-step arithmetic that introduces errors under time pressure. Enter the value in whatever base you have, and all equivalents display simultaneously — the same value expressed four different ways at once, ready to use in whatever context requires it.