Number Base Converter
Convert between Binary, Octal, Decimal, and Hexadecimal
No data is sent to any server — everything runs client-side
Type in any field — the others update in real-time. Supports large numbers via BigInt.
Understanding Number Bases
A number base (or radix) defines how many unique digits are used to represent numbers. We use base-10 (decimal) in everyday life because we have 10 fingers. Computers use base-2 (binary) because transistors have two states (on/off). Hexadecimal (base-16) is a convenient shorthand for binary — each hex digit maps to exactly 4 binary digits.
Quick Reference
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 |
| 2 | 10 | 2 | 2 |
| 4 | 100 | 4 | 4 |
| 8 | 1000 | 10 | 8 |
| 10 | 1010 | 12 | A |
| 15 | 1111 | 17 | F |
| 16 | 10000 | 20 | 10 |
| 32 | 100000 | 40 | 20 |
| 64 | 1000000 | 100 | 40 |
| 127 | 1111111 | 177 | 7F |
| 128 | 10000000 | 200 | 80 |
| 255 | 11111111 | 377 | FF |
| 256 | 100000000 | 400 | 100 |
When to Use
CSS Colors
Hex color codes (#FF5733) are base-16 RGB values. Convert to decimal to find the exact R/G/B values (255, 87, 51).
Bitwise Operations
Debug bit flags, permissions (chmod 755 = 111 101 101), and bitwise AND/OR/XOR operations by viewing values in binary.
Memory Addresses
Memory addresses and pointers are displayed in hex. Convert to decimal for offsets or binary for bit-level analysis.
Network & IP
Subnet masks (255.255.255.0 = 11111111.11111111.11111111.00000000), IPv6 addresses (hex), MAC addresses (hex).
Related Tools
Frequently Asked Questions
Why do computers use binary (base-2)?▼
Computers use binary because their fundamental storage and processing units — transistors and logic gates — have two stable states: on (1) and off (0). This maps naturally to binary digits. All more complex data types (integers, floats, text, images) are ultimately encoded as sequences of bits.
Why is hexadecimal used so often in programming?▼
Hexadecimal (base-16) is a compact shorthand for binary. Each hex digit represents exactly 4 binary digits (nibble), so a byte (8 bits) is always exactly 2 hex digits. This makes memory addresses, color codes (#FF5733), and bitmasks much more readable than their binary equivalents.
What is the largest number this converter can handle?▼
This tool uses JavaScript BigInt which supports arbitrarily large integers — there is no practical upper limit. It handles 64-bit values and beyond.
How do I convert a negative number?▼
This tool works with non-negative integers (unsigned). For negative numbers in two's complement representation (common in low-level programming), you would need to know the bit width and interpret accordingly. Enter the raw bit pattern and convert from binary.
What is octal (base-8) used for?▼
Octal is used primarily in Unix/Linux file permissions. chmod 755 means owner has rwx (111₂ = 7), group has r-x (101₂ = 5), others have r-x (101₂ = 5). Each octal digit represents exactly 3 binary bits.
Further Reading
Built by JDApplications