What Is the Number Base Converter?
Convert numbers between binary, octal, decimal, and hexadecimal. See all representations simultaneously with step-by-step conversion explanations.
Why Use This Tool?
Working with different number bases is common in programming — hex for colors and memory addresses, binary for bitwise operations, octal for file permissions. This tool converts between all four major bases instantly.
How to Use This Number Base Converter
- Enter your number — Type or paste the number you want to convert into the input field.
- Select the input base — Choose the base (radix) of your input number — binary (base 2), octal (base 8), decimal (base 10), or hexadecimal (base 16).
- Read the conversions — All other base representations update instantly. Copy any result with one click.
- Try different values — Test edge cases like negative numbers, large values, or floating-point representations to understand how different bases handle them.
Tips and Best Practices
- → Learn the mental shortcuts. Hex digits map directly to 4 binary digits: A=1010, F=1111. Memorizing a few of these lets you read hex as binary at a glance.
- → Use hex for colors and memory. Hexadecimal is the standard for CSS colors (#FF6B6B), memory addresses, and byte values because each hex digit represents exactly 4 bits.
- → Use octal for Unix permissions. File permissions like 755 are octal — each digit represents 3 bits for read, write, and execute. See our Chmod Calculator for a visual breakdown.
- → Prefix numbers to avoid ambiguity. In code, use 0b for binary (0b1010), 0o for octal (0o755), and 0x for hex (0xFF). This prevents confusion between base-10 and other representations.
Frequently Asked Questions
When do I need hex numbers?
Hexadecimal is used for CSS colors (#FF6B6B), memory addresses, Unicode code points (U+1F600), and byte-level data representation.
How do I read binary numbers?
Binary uses only 0 and 1. Each position represents a power of 2 from right to left: 1, 2, 4, 8, 16... So binary 1010 = 8 + 2 = decimal 10.
What's the relationship between hex and binary?
Each hex digit represents exactly 4 binary digits: F = 1111, A = 1010, 0 = 0000. This makes hex a compact way to write binary data.
Why do computers use binary?+
Digital circuits have two states — on (1) and off (0) — making binary the natural language of hardware. All other number bases are human conveniences for reading and writing binary more compactly.
What is hexadecimal used for in programming?+
Hexadecimal is used for color codes (CSS, design tools), memory addresses, byte representations, MAC addresses, and anywhere compact binary representation is needed. Each hex digit maps to exactly 4 binary digits, making conversion straightforward.
How do I convert binary to decimal manually?+
Multiply each binary digit by its positional power of 2, then sum the results. For example, 1011 = (1×8) + (0×4) + (1×2) + (1×1) = 11 in decimal.
Why does the converter not handle negative numbers consistently?+
Representations of negative numbers vary by base: binary uses two-complement, hex usually uses two-complement, decimal uses a sign character, octal generally avoids negatives. The converter handles signed decimal-to-binary conversion using two-complement at common bit widths (8, 16, 32, 64) and lets you choose the bit width. For unsigned conversion (no negatives), the bit width does not matter. The mode selector makes the choice explicit.
Can it handle fractional numbers?+
Yes, but with caveats. Fractional decimal to binary often produces infinite repeating fractions (0.1 in decimal is repeating in binary). The converter truncates to the precision you select (default 32 bits). For lossless representation across bases, stick to integers or specify the fraction explicitly as a ratio.
Built by Derek Giordano · Part of Ultimate Design Tools
Privacy Policy · Terms of Service