Instant two-way conversion between binary, octal, decimal and hex.
What is a base (radix) converter?
A number base converter translates a value between different counting systems. The most common bases are decimal (base 10, everyday numbers), binary (base 2, used by computers), octal (base 8) and hexadecimal (base 16, used in programming and color codes). Each digit in a number represents a power of the base, and the converter handles the arithmetic instantly.
How binary to decimal conversion works
Each binary digit (bit) represents a power of 2, starting from the right with 2⁰. To convert binary to decimal, multiply each bit by its corresponding power of 2 and sum them:
Example: 1011₂ = 1×2³ + 0×2² + 1×2¹ + 1×2⁰ = 8 + 0 + 2 + 1 = 11
Hexadecimal works the same way but uses base 16, with digits 0–9 and A–F (where A=10, B=11, ..., F=15). For example, 1F₁₆ = 1×16 + 15 = 31.
Step-by-step: convert between bases
- Enter the number. Type the value you want to convert in the input field.
- Select its current base. Choose the base of the number you entered (binary, octal, decimal, or hexadecimal).
- Read all conversions. The converter instantly displays the value in all four bases simultaneously.
When to use each base
- Binary (base 2): The language of computers. Every file, image and program is ultimately stored as 0s and 1s. Useful for understanding bitwise operations and network masks.
- Octal (base 8): Historically used for Unix file permissions (e.g. chmod 755) and early computing. Less common today but still appears in legacy systems.
- Decimal (base 10): The standard human counting system with digits 0–9. Used everywhere in daily life.
- Hexadecimal (base 16): Compact representation of binary in programming. Used for memory addresses, color codes (#FF5733), and Unicode code points.
Practical examples
- Web colors: A color like #2563EB is hexadecimal. 25₁₆ = 37 red, 63₁₆ = 99 green, EB₁₆ = 235 blue.
- File permissions: chmod 755 in octal means rwxr-xr-x — owner has full access, group and others can read and execute.
- IP subnet masks: A /24 subnet mask is 255.255.255.0 in decimal, which is 11111111.11111111.11111111.00000000 in binary.
- Debugging: When a program shows a hex error code, convert it to decimal to look up the error in documentation.
FAQ
How does binary to decimal conversion work?
Each binary digit represents a power of 2. Example: 1011₂ = 1×2³ + 0×2² + 1×2¹ + 1×2⁰ = 11. Hexadecimal uses powers of 16 with digits 0–9 and A–F.
What is hexadecimal used for?
Hexadecimal (base 16) is used in programming for memory addresses, web color codes (like #2563EB), and Unicode code points. It is a compact way to represent binary data.
How do I convert decimal to binary?
Repeatedly divide the decimal number by 2 and collect the remainders from last to first. For example, 11 ÷ 2 gives remainders 1,1,0,1 (read backwards) = 1011 in binary.
Why do computers use binary?
Computers use binary because electronic circuits have two natural states: on (1) and off (0). This makes binary the simplest and most reliable way to store and process data electronically.
What is octal used for?
Octal (base 8) is mainly used in Unix-like systems for file permissions (chmod commands like chmod 755). It was more common in early computing but has largely been replaced by hexadecimal.