🔢 Decimal Base Converter – Convert Between Any Number Systems
The Decimal Base Converter is an essential tool for developers, computer science students, and engineers who work with different numeral systems. It converts numbers between decimal (base-10), binary (base-2), octal (base-8), hexadecimal (base-16), and any arbitrary base from 2 to 36 — with full support for fractional numbers and step-by-step algorithmic breakdowns.
📐 How Number Base Conversion Works
Every number system is a positional notation system, meaning the value of each digit depends on its position (its "place value"). The base determines how many unique digit symbols the system uses before "rolling over" to the next position.
For example, decimal (base-10) uses digits 0–9, while hexadecimal (base-16) uses 0–9 plus letters A–F (where A=10, B=11, … F=15).
⚙️ Core Conversion Algorithms
Decimal → Target Base (Integer Part)
The standard algorithm repeatedly divides the number by the target base and collects the remainders in reverse order:
255 ÷ 2 = 127 remainder 1
127 ÷ 2 = 63 remainder 1
63 ÷ 2 = 31 remainder 1
31 ÷ 2 = 15 remainder 1
15 ÷ 2 = 7 remainder 1
7 ÷ 2 = 3 remainder 1
3 ÷ 2 = 1 remainder 1
1 ÷ 2 = 0 remainder 1
→ Binary: 11111111Any Base → Decimal
To convert from another base to decimal, use positional notation — multiply each digit by the base raised to the power of its position and sum them all:
FF (hex) = 15 × 16¹ + 15 × 16⁰
= 240 + 15
= 255 (decimal)Cross-Base Conversion
Converting between two non-decimal bases (e.g., binary to octal) uses a two-step pipeline: source base → decimal → target base. The intermediate decimal value is shown in the step-by-step panel.
Fractional Number Conversion
Fractional parts are converted using repeated multiplication. Multiply the fractional part by the target base repeatedly, collecting the integer parts of each product:
Convert 0.625 (decimal) to binary:
0.625 × 2 = 1.25 → digit 1
0.25 × 2 = 0.5 → digit 0
0.5 × 2 = 1.0 → digit 1
→ 0.101 (binary)🖥️ Why Number Bases Matter in Computing
Understanding number bases is fundamental to computer science and low-level programming. Here is how each common base is used in practice:
- Binary (Base 2): The native language of computers. Every piece of data — from text to images to programs — is ultimately stored as sequences of 0s and 1s. Understanding binary is essential for bitwise operations, CPU registers, memory addressing, and network protocols.
- Octal (Base 8): Once common in older computing systems, octal is still used today for Unix/Linux file permissions. A permission mask like
chmod 755is an octal number where each digit encodes three permission bits (read, write, execute). - Hexadecimal (Base 16): The most practical shorthand for binary. Each hex digit encodes exactly four binary bits (a "nibble"), making it compact and readable. Hex is used everywhere: memory addresses, RGB color codes (
#FF6B00), SHA hashes, IPv6 addresses, and assembly language. - Custom Bases (2–36): Base-36 uses all digits and letters and is sometimes used for compact identifiers or short URLs. Base-32 is common for encoding data in case-insensitive contexts. Base-60 (sexagesimal) historically underlies our time and angle measurement systems.
📊 Binary and Hex Relationship
Because 16 = 2⁴, each hex digit corresponds to exactly 4 binary bits (a nibble), and each octal digit corresponds to exactly 3 binary bits (because 8 = 2³). This makes conversion between these bases trivial — just group the binary digits:
Binary: 1111 1111
Hex: F F → FF
Octal: 011 111 111 → 377🎯 How to Use This Tool
- Enter your number in the Input field. For bases above 10, use digits
A–Z(case-insensitive). - Select the source base — the system your input number is written in. Defaults to decimal (10).
- Select the target base — the system you want to convert to, or enter a custom base from 2 to 36.
- Results appear instantly for all four common bases (binary, octal, decimal, hexadecimal) plus your custom target.
- Toggle Show Steps to see the full division/multiplication algorithm, and click any result card to copy it to clipboard.
💡 Tips and Limitations
- Precision: Integer conversions are exact up to JavaScript's safe integer limit (2⁵³ − 1 ≈ 9 quadrillion). Fractional conversions use floating-point arithmetic and may have small rounding errors, especially for irrational fractions in the target base.
- Repeating fractions: Just as 1/3 cannot be expressed exactly in decimal, many fractions cannot be represented exactly in binary. For example, 0.1 decimal has an infinitely repeating binary expansion (0.0001100110011…).
- Bit visualization: The binary output is displayed as a color-coded bit grid, grouped into nibbles (4 bits), for easy reading of byte patterns.
- Uppercase output: All letters in the output (for bases above 10) are displayed in uppercase by convention (e.g.,
FFnotff).