Number Base Converter

Convert numbers between binary, octal, decimal, and hexadecimal bases instantly.

Conversions

How It Works

Enter a number and select its current base (binary, octal, decimal, or hexadecimal). The tool instantly converts and displays the equivalent value in all four number bases simultaneously.

Number base conversion is a fundamental skill in computer science and digital electronics. Our free number base converter instantly translates values between binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16).

**The Four Number Bases**

**Binary (Base 2)** uses only 0 and 1. It is the foundation of all digital computing — every piece of data in a computer is ultimately stored as binary. Understanding binary is essential for bitwise operations, low-level programming, and computer architecture.

**Octal (Base 8)** uses digits 0–7. It was historically used in computing because each octal digit maps exactly to 3 binary digits, making binary more readable. Unix file permissions (like chmod 755) are expressed in octal.

**Decimal (Base 10)** is the familiar number system we use in everyday life, using digits 0–9. All standard arithmetic and most programming languages default to decimal for numeric literals.

**Hexadecimal (Base 16)** uses digits 0–9 and letters A–F. Each hex digit maps to exactly 4 binary digits (nibble), making it compact for representing binary data. Used extensively for: memory addresses, color codes (#FF5733), byte values, and CPU instructions.

**Real-World Applications**

- **Color codes**: `#1A2B3C` = R:26, G:43, B:60 in decimal
- **Memory addresses**: `0x7FFF5FBF8000` in hexadecimal
- **File permissions**: `chmod 755` = binary 111 101 101
- **Bitwise operations**: easier to visualize in binary
- **Network masks**: subnet masks shown in binary

**Conversion Tips**

To convert binary to hex, group binary digits in sets of 4 from the right and convert each group. To convert decimal to any base, repeatedly divide by the target base and collect remainders.

**Privacy**

All calculations happen locally in your browser.

Frequently Asked Questions

Binary is a number system using only 0 and 1. All digital computers use binary internally because electronic circuits have two states: on (1) and off (0).
Hexadecimal (base 16) is used for memory addresses, color codes, byte values, and CPU instructions. It provides a compact way to represent binary data because each hex digit equals exactly 4 binary digits.
Multiply each binary digit by 2 raised to its position power, then sum the results. For 1011: (1×8) + (0×4) + (1×2) + (1×1) = 11 in decimal.
Unix permissions use 3 bits each for owner, group, and others. Read=4, Write=2, Execute=1. chmod 755 means owner has all permissions (7=4+2+1), group and others have read+execute (5=4+1).
The converter handles numbers within JavaScript's safe integer range (up to 2^53 - 1). For very large numbers, use a specialized big-integer library.