Number Base Converter
Convert numbers between binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16) in real-time as you type.
How to Use the Number Base Converter
Enter a number in the input field and select its current base from the dropdown menu. The converter instantly displays the equivalent value in all four number bases โ binary, octal, decimal, and hexadecimal. Results update in real-time as you type, with a copy button next to each result for quick clipboard access.
This tool supports integers of any reasonable size. For hexadecimal input, you can use either uppercase (A-F) or lowercase (a-f) letters. The output always displays uppercase hexadecimal letters for consistency.
Number Base Conversion Methods
Every number base conversion goes through a two-step process internally: (1) parse the input number in its source base to get its decimal value, and (2) convert the decimal value to the target base. Here are the manual methods for common conversions:
- Binary โ Decimal: Multiply each digit by its positional power of 2 and sum them. Example: 1101โ = 1ร8 + 1ร4 + 0ร2 + 1ร1 = 13.
- Decimal โ Binary: Repeatedly divide by 2 and read the remainders bottom-to-top. Example: 13 รท 2 = 6r1, 6 รท 2 = 3r0, 3 รท 2 = 1r1, 1 รท 2 = 0r1 โ 1101โ.
- Hex โ Binary: Replace each hex digit with its 4-bit binary equivalent. Example: 2Fโโ = 0010 1111โ.
- Binary โ Hex: Group bits into sets of 4 from the right and convert each group. Example: 10111100โ = BCโโ.
Common Conversions Reference
| Decimal | Binary | Octal | Hexadecimal |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 8 | 1000 | 10 | 8 |
| 10 | 1010 | 12 | A |
| 16 | 10000 | 20 | 10 |
| 255 | 11111111 | 377 | FF |
| 256 | 100000000 | 400 | 100 |
| 1024 | 10000000000 | 2000 | 400 |
Where Number Bases Are Used
Binary is the foundation of all digital computing โ every piece of data in a computer is stored and processed as sequences of 0s and 1s. Hexadecimal is the preferred notation for programmers because it compactly represents binary data: each hex digit corresponds to exactly 4 bits. CSS color codes like #FF5733, memory addresses, and MAC addresses all use hexadecimal. Octal was historically used in Unix file permissions (e.g., chmod 755) and some older computing systems. Decimal is the standard human-readable number system used in everyday mathematics and commerce.
Frequently Asked Questions
What is a number base (radix) and why does it matter?
A number base, or radix, is the number of unique digits used to represent numbers in a positional numeral system. Decimal (base 10) uses digits 0-9, binary (base 2) uses 0 and 1, octal (base 8) uses 0-7, and hexadecimal (base 16) uses 0-9 and A-F. Different bases are used in different contexts โ computers use binary internally, programmers use hexadecimal for compact representation, and humans default to decimal.
How do I convert binary to decimal manually?
Each digit in a binary number represents a power of 2, starting from the right at 2^0. To convert binary 1011 to decimal: (1ร2ยณ) + (0ร2ยฒ) + (1ร2ยน) + (1ร2โฐ) = 8 + 0 + 2 + 1 = 11. This converter does this calculation instantly for any binary number you enter.
Why is hexadecimal used in programming?
Hexadecimal is widely used in programming because it provides a compact way to represent binary data. Each hex digit maps to exactly 4 binary digits (bits), so a byte (8 bits) is represented by exactly 2 hex digits. This makes it much easier to read memory addresses, color codes (#FF0000), MAC addresses, and other binary data compared to long strings of 0s and 1s.