What Is a Number Base?
A number base (also called a radix) is the size of the digit system you use to write numbers. Decimal is base 10, which means each position represents a power of 10. Binary is base 2, where each position represents a power of 2. Hexadecimal is base 16, where each position represents a power of 16, and digits extend beyond 0–9 using letters.
Base conversion matters because different bases make different tasks easier. Humans generally count in base 10, computers store data in base 2, and developers often use base 16 (hex) because it compresses long binary strings into shorter, readable values.
How Base Conversion Works Conceptually
Converting between bases is mostly about place value. A digit’s value depends on its position. In base b, the rightmost digit is b⁰, the next is b¹, then b², and so on. To convert to decimal, you expand the number as a sum of digit × base^position. To convert from decimal to a target base, you repeatedly divide (for integers) and repeatedly multiply (for fractions).
Digits Beyond 9: Why Letters Appear
Bases greater than 10 need more than ten symbols. The standard convention is to keep 0–9 and then continue with letters A–Z for 10–35. That means base 16 uses A–F, base 32 uses A–V, and base 36 uses A–Z.
Binary, Octal, Decimal, and Hex at a Glance
Binary (Base 2)
Binary uses only 0 and 1. It maps directly to bits, which is why it’s the foundation of computing. Long binary values are often grouped in sets of four to improve readability.
Octal (Base 8)
Octal uses digits 0–7. It is less common today than hex, but it still appears in places like Unix file permissions, where it provides a compact way to represent bit patterns.
Decimal (Base 10)
Decimal is the base most people use daily. Many conversions are easiest to reason about by translating to decimal first because you can “see” the magnitude intuitively.
Hexadecimal (Base 16)
Hex uses digits 0–9 and A–F. It’s widely used in programming and systems work because 1 hex digit represents exactly 4 binary bits. That makes binary-to-hex conversion especially clean and compact.
Converting Integers: Repeated Division
To convert a decimal integer to a target base, you divide by the base and record remainders. The first remainder is the least significant digit. You keep dividing the quotient until it becomes zero, then reverse the remainder list. This is why binary conversion often looks like repeated division by 2.
Converting Fractions: Repeated Multiplication
Fractions convert by multiplying the fractional part by the target base. The integer part of the result becomes the next digit, and you repeat with the new fractional remainder. This method is powerful but it has a catch: some fractions don’t terminate in some bases.
For example, 0.1 in decimal becomes a repeating fraction in binary, similar to how 1/3 repeats in decimal as 0.333… That’s why this calculator lets you choose a maximum number of fractional digits to output.
Why Some Conversions Repeat
A fraction terminates in a base only when its denominator (in lowest terms) has no prime factors other than the prime factors of the base. Decimal (base 10) has prime factors 2 and 5, so fractions like 1/2 and 1/5 terminate, but 1/3 repeats. Binary (base 2) has only prime factor 2, so only fractions with denominators that are powers of two terminate.
Grouping Output for Readability
When numbers get long, grouping helps you avoid mistakes. Grouping is purely visual: it doesn’t change the value. Common patterns include grouping binary in sets of 4 (nibbles) or 8 (bytes), and grouping hex in sets of 2 (bytes). This tool can group output automatically, or you can choose a grouping size yourself.
Practical Use Cases
Debugging and memory addresses
Developers often see hex values in logs, stack traces, and memory inspectors. Converting hex to decimal can help you compare sizes, offsets, and thresholds.
Colors in web design
HTML/CSS colors are commonly written in hex (like #FF8800). Each pair of hex digits represents a color channel value from 0 to 255 in decimal.
Bit masks and flags
Binary and hex are both useful for representing bit masks. Binary shows the individual bits clearly, while hex keeps values compact.
Short IDs and encodings
Base-36 and base-32 are frequently used to create short, human-shareable identifiers using numbers and letters.
How to Avoid Common Input Errors
Entering a digit that doesn’t exist in the base
If your source base is 2, only 0 and 1 are allowed. If your source base is 16, digits can be 0–9 and A–F. Any symbol outside the allowed range makes the input invalid.
Mixing separators or using commas in the value
Use a dot (.) as the fractional separator. Don’t include commas inside the input value. If you need grouping, apply it to the output instead.
Assuming fractional conversions are always exact
Integer conversions are exact. Fractional conversions can repeat and require rounding. If you need more precision, raise the “Fraction Digits” setting.
Examples to Try Right Now
- Binary to decimal: 101101 → 45
- Hex to decimal: FF → 255
- Decimal to hex: 2025 → 7E9
- Octal to binary: 17 → 1111
- Base-36 to decimal: Z → 35
- Decimal fraction to binary: 0.1 (repeats; increase fraction digits)
Limitations and Safe Use Notes
This converter is designed for clarity and planning. Very large inputs or very long fractional expansions can exceed JavaScript’s numeric precision. For typical engineering, programming, and learning use, the outputs are reliable. If you need exact arbitrary-precision arithmetic for huge values, consider specialized big-integer tooling.
FAQ
Base Converter Calculator – Frequently Asked Questions
Answers to common questions about base conversion, valid digits, fractions, and readability grouping.
A base converter converts a number written in one base (like binary base-2 or hex base-16) into an equivalent value in another base (like decimal base-10).
It supports any base from 2 to 36, including binary (2), octal (8), decimal (10), hexadecimal (16), and custom bases like 3, 12, or 32.
Yes. It supports a fractional separator (.) and converts fractional parts by multiplying by the target base repeatedly (with a configurable digit limit).
Yes. You can prefix a minus sign (-). The calculator converts the magnitude and re-applies the sign in the output.
Digits 0–9 are used first, then letters A–Z represent values 10–35. For example, in base-16, A=10 and F=15.
Each base only allows digits up to its maximum. For base-2 only 0 and 1 are valid; for base-16 valid symbols are 0–9 and A–F.
Grouping adds separators to make long strings easier to read, such as grouping binary in 4s (nibbles) or hex in 2s (bytes). It does not change the value.
Integer conversions are exact. Fractional conversions may be rounded because some fractions cannot be represented exactly in a different base.
Yes. The History tab stores conversions and you can export them to CSV.