Conversion
Binary / Number Base Converter
Convert numbers between binary, decimal, hexadecimal, and octal. All bases displayed simultaneously with bit length.
Enter a number and select its base
Binary (Base 2)
Decimal (Base 10)
Hexadecimal (Base 16)
Octal (Base 8)
Bit Length
How is this calculated?
Formula: Parse input from source base, then convert to all target bases.
Step 1: Parse input to decimal
decimal = parseInt(input, fromBase)
Step 2: Convert decimal to all bases
binary = decimal.toString(2)
hex = decimal.toString(16).toUpperCase()
octal = decimal.toString(8)
Bit Length:
bits = binary.length
(minimum bits needed to represent the number)
Example: "FF" (hex) → 255 (dec) → 11111111 (bin) → 377 (oct)
Bit length: 8 Conversion history
No conversions yet.
FAQ
Frequently asked questions
What are number bases (radix) and why do they matter?
A number base (radix) defines how many unique digits are used to represent numbers. Decimal (base-10) uses 0-9, binary (base-2) uses 0-1, hexadecimal (base-16) uses 0-9 and A-F, octal (base-8) uses 0-7. Different bases are used in computing: binary for hardware logic, hex for memory addresses and colors, octal for Unix file permissions.
Why do computers use binary?
Computers use binary because digital circuits have two states: on (1) and off (0), represented by high and low voltage. This makes binary the natural language of electronics. Every piece of data — text, images, programs — is ultimately stored and processed as sequences of 0s and 1s. Higher-level representations (hex, decimal) are for human convenience.
How do I convert binary to decimal manually?
Multiply each binary digit by its positional value (powers of 2 from right to left) and sum them. For example, 1011₂ = 1×2³ + 0×2² + 1×2¹ + 1×2⁰ = 8 + 0 + 2 + 1 = 11₁₀. Each position doubles in value: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024...
Why is hexadecimal so common in programming?
Hexadecimal maps perfectly to binary: each hex digit represents exactly 4 binary digits (bits). So a byte (8 bits) is always exactly 2 hex digits (00-FF). This makes hex much more compact than binary while maintaining a direct relationship. Memory addresses, color codes (#FF0000), and byte values are all cleaner in hex.
What is bit length and why does it matter?
Bit length is the number of binary digits needed to represent a number. It determines storage requirements and data type boundaries. Common boundaries: 8-bit (byte, 0-255), 16-bit (0-65535), 32-bit (0-4.29 billion), 64-bit. Understanding bit length helps with data types, memory allocation, and avoiding overflow errors in programming.