Base-n Converter
The base-n converter converts any number from one number base to another, supporting any base from 2 (binary) to 36. Every positional number system uses a base, also called a radix, which defines how many distinct digit symbols are available and what each digit position is worth. Base 10 (decimal) uses the digits 0 through 9 and is the system you use every day. Base 2 (binary) uses only 0 and 1 and is the native language of computers. Base 16 (hexadecimal) uses 0 through 9 and the letters A through F, and is widely used to represent memory addresses, colour values, and byte data compactly. Bases higher than 10 use the letters of the alphabet as extra digit symbols: A represents 10, B represents 11, and so on up to Z representing 35 in base 36. You enter the number you want to convert and select both the original base and the target base. The calculator converts your input to base 10 as an intermediate step, then converts from base 10 to the target base using repeated division, and shows you the step-by-step division table so you can trace exactly how each digit of the result is produced. The result is displayed in uppercase. The tool is useful for students learning digital electronics, developers working with binary or hex data, and anyone exploring the mathematics of positional notation. Inputs must use only valid digit characters for the chosen source base; letters A to Z are accepted for bases above 10. Results are exact for integers.
How it works
The conversion uses a two-step process. Step 1: convert the source number to base 10 using JavaScript's parseInt(value, fromBase), which evaluates each digit position as a power of the source base. Step 2: convert the base-10 integer to the target base using decimalValue.toString(toBase), which implements repeated division internally. The step-by-step table shown below the result illustrates the repeated division manually: at each step, the current value is divided by the target base, the remainder becomes a digit of the result (reading from bottom to top), and the quotient becomes the next dividend. Digits above 9 are shown as letters (A=10, B=11, ..., F=15 in hex).
Worked example
Using the default values: 255 in base 10 converted to base 16 (hexadecimal). Step 1: 255 in decimal is already base 10, so no conversion needed. Step 2: 255 divided by 16 is 15 remainder 15 (F). 15 divided by 16 is 0 remainder 15 (F). Reading the remainders from bottom to top gives FF. This matches the hex colour #FF used in web design for full-intensity red, green, or blue channels.
Related calculators
- Remainder Calculator: the repeated division at the heart of base conversion.
- Matrix Determinant Calculator: another tool using integer arithmetic in discrete maths.
- Percent Error Calculator: check the accuracy of a manual base conversion.
- Percentage Calculator: work with percentages in related numerical problems.