Number Base Converter
Convert numbers between arbitrary bases (2–36). Supports integer and fractional parts, signed/unsigned interpretation (two's complement), grouping/padding (8/16/32 bits), step-by-step trace, and CSV export.
Number Base Converter — convert binary, octal, decimal, hexadecimal and any base (2–36)
Number base conversion is a fundamental operation in computer science, electronics, mathematics, and many engineering disciplines. The Number Base Converter on AkCalculators helps you convert integers and fractional numbers between arbitrary bases from 2 to 36. It supports signed and unsigned interpretations, two's complement format, bit-width padding, grouping (nibbles, bytes), and provides detailed step-by-step traces so you can learn or debug conversions.
Why base conversion matters
Different fields use different bases: binary (base 2) is native to digital electronics, octal and hexadecimal (bases 8 and 16) are convenient compact representations of binary data, and decimal (base 10) is the human-friendly system. Converting between bases is essential when working with low-level data, debugging bit-level issues, understanding floating-point internals, and implementing algorithms that depend on positional notation.
How positional notation works
In any base b, a number is represented using digits 0..b−1. For an integer with digits dₖ…d₂d₁d₀, its value is Σ dᵢ·bⁱ. Fractional parts use negative powers: d−1/b + d−2/b² + .... The converter uses these definitions to compute exact rational values where possible for the integer and fractional parts separately, then re-encodes into the target base with the requested precision.
Integer conversion (target base)
To convert an integer from base A to base B, a reliable approach is:
- Parse each digit of the input in base A to compute its integer value (in an internal big-integer / rational form if needed).
- Perform repeated division by base B to obtain remainders: divide the integer by B, record the remainder (lowest digit), then replace the integer by the quotient and repeat until quotient is zero. The remainders reversed form the digits in base B.
Fractional conversion (source to target)
For fractions, conversion is done by repeated multiplication:
- Take the fractional part f (0 ≤ f < 1).
- Multiply f by the target base B; the integer part of the product is the next digit.
- Subtract the integer part to get a new fractional remainder; repeat to get more digits.
Some fractions terminate (e.g., 0.5 in base 2) while others repeat in a periodic pattern (e.g., 1/3 = 0.333... in base 10; in base 2 it’s repeating). The converter detects repeating patterns when possible and shows truncated results with a note on rounding and precision when the expansion does not terminate within the requested digits.
Signed numbers and two's complement
Signed integers are commonly represented using two's complement in computing. To interpret an input as two's complement with bit-width N:
- If the highest (most-significant) bit is 0, treat as positive and convert as usual.
- If the highest bit is 1, compute the negative value by subtracting 2N (or compute the two's complement inversion). The converter accepts a signed/unsigned toggle and a bit-width so you can view equivalent signed values.
Practical examples and presets
The converter includes byte/word presets (8/16/32/64 bits) and grouping options to display binary output in nibble/byte/word groups. Examples:
- Convert hex `FF` to decimal: `FF` (base 16) → 255 (decimal) → binary `11111111` (8-bit).
- Convert binary `1011.101` (base 2) to decimal: integer 1011₂ = 11₁₀, fraction .101₂ = 1/2 + 0/4 + 1/8 = 0.625, so 11.625₁₀.
- Convert decimal 26 to hex: repeated division by 16 yields 1A (hex).
Rounding, precision and repeating fractions
Fractional expansions may not terminate in the target base. This tool allows you to choose the fractional digit precision. When a repeating pattern is detected, the converter will indicate the repeating segment if it can be found within the computed digits, or else will show a truncated result and explain the rounding used.
Validation and error handling
The converter validates digits against the source base (e.g., 'F' is invalid for base 10). It also handles extremely large integers by operating on JavaScript's arbitrary-precision BigInt where available, or by using safe string-based arithmetic for very wide inputs. Negative inputs are normalized according to the signed/unsigned selection and bit width if provided.
Educational value and debugging
Detailed step-by-step traces — showing repeated division for integer parts and repeated multiplication for fractional parts — make this tool excellent for teaching and debugging. Use the step-by-step mode to see the exact intermediate remainders and multiplications that produce each digit in the target base.
Tips and common pitfalls
- Remember that fractional termination depends on the factors of the base: fractions whose denominator factors are only primes dividing the base will terminate (e.g., 1/2 terminates in base 10 and base 2). Others will repeat.
- Be mindful when converting negative numbers — select the correct signed option and bit width to see the intended interpretation.
- Use padding and grouping to match how memory or network data is represented (e.g., grouping binary into bytes for readability).
Conclusion
The AkCalculators Number Base Converter provides a comprehensive, practical and educational environment to convert between bases 2–36, handle fractional parts, signed interpretations, and view step-by-step traces. Whether you’re debugging low-level code, studying computer architecture, or learning positional notation, this converter makes base conversions transparent and repeatable.
Frequently Asked Questions
Supports integer bases 2 through 36 (binary..base-36). For bases > 10 the digits A..Z represent values 10..35.
Yes — enter the fractional part after '.' and set precision for fractional digits in the output.
Use the Signed option and choose Two's complement plus a bit width to see the signed interpretation (e.g., 16-bit two's complement).
The tool validates input and will highlight or reject digits not allowed by the source base (e.g., '9' in base 8 is invalid).
You can set the fractional precision — common defaults are 8–12 digits. Repeating expansions may be truncated and noted.
Yes — group by 4/8/16 bits for readability; useful for mapping binary to hex bytes or words.
Yes — enable Show steps to see division traces for integer conversion and multiplication traces for fractional conversion.
Integer conversions are exact. Fractional conversions are exact up to detected repeating cycles or chosen precision; the tool reports truncation/rounding when necessary.
Yes — use Download CSV to save the input, outputs, and step-by-step trace for offline study.
Absolutely — the conversion traces and signed/unsigned toggles make this ideal for classroom demonstrations and self-study.