Base-N Number Converter (Bases 2–36)

JJ Ben-Joseph headshot JJ Ben-Joseph

What This Base-N Converter Does

This calculator converts integers between any two bases from 2 to 36. You can move freely between binary (base 2), octal (base 8), decimal (base 10), hexadecimal (base 16), and any other base in that range. The tool uses digits 0–9 and letters A–Z (case-insensitive) and works entirely in your browser, so the numbers you enter are not sent to a server.

The converter only changes how a number is written; it does not change its underlying value. For example, the decimal number 255 is the same quantity as the hexadecimal number FF and the binary number 11111111. They are three different representations of one integer.

On this page you will find:

  • An overview of positional number systems and base-N notation.
  • The formulas used to interpret and re-express numbers in different bases.
  • Examples of binary, decimal, hexadecimal, and base-36 conversions.
  • A comparison table showing the same value in several common bases.
  • A short list of limitations and assumptions for this specific tool.

How Positional Number Systems Work

Most number systems used in mathematics and computing are positional. In a positional system, the value of each digit depends on both the symbol itself and the position it occupies. Each position has a weight that is a power of the base (also called the radix).

In base 10 (the decimal system), the number 457 means:

4 × 102 + 5 × 101 + 7 × 100 = 400 + 50 + 7.

In base 2 (binary), each position is a power of 2. The binary number 1011 represents:

1 × 23 + 0 × 22 + 1 × 21 + 1 × 20 = 8 + 0 + 2 + 1 = 11 in decimal.

More generally, if you have a number written in base b with digits from the most significant digit dk down to the least significant digit d0, its value N in decimal can be written as a polynomial in the base:

N = i=0 d i · b i

Here, each digit di is an integer from 0 up to (but not including) the base b. The base-N converter evaluates this positional polynomial for the source base and then expresses the same value using digits in the target base.

Supported Bases and Digit Symbols (2–36)

This tool supports any integer base from 2 through 36. The available digit symbols are:

  • 0–9 for values 0 through 9.
  • A–Z for values 10 through 35.

Letters are treated in a case-insensitive way, so a and A are equivalent.

Some common bases include:

  • Base 2 (binary): symbols 0 and 1. Widely used inside computers.
  • Base 8 (octal): symbols 0–7. Historically used in some older systems.
  • Base 10 (decimal): symbols 0–9. The everyday human number system.
  • Base 16 (hexadecimal): symbols 0–9 and A–F. Common in programming and debugging.
  • Base 36: symbols 0–9 and A–Z. Useful for compact IDs and codes.

How the Conversion Algorithm Works

Converting between bases is usually done in two steps:

  1. Parse the input number (as a string) in the source base to get its integer value.
  2. Rebuild the number in the target base using repeated division or built-in base conversion routines.

Conceptually, step 1 evaluates the positional polynomial in the source base. Step 2 finds the digits for the same integer value in the target base.

In many programming languages, including JavaScript, these steps are implemented by built-in functions that already understand bases 2 to 36. The internal workflow typically looks like this:

  • Accept the input string, including an optional leading minus sign.
  • Check that each character is valid for the chosen source base.
  • Interpret the digits according to the source base to get an integer.
  • Convert the resulting integer into a string in the target base.
  • Use uppercase letters for digits 10 through 35 in the final result.

This approach is compact, reliable for a wide range of integers, and runs entirely in your browser. No network request is required once the page has loaded.

Interpreting the Results

After you enter a number, select its base, and choose a target base, the calculator displays a single output number. Keep these points in mind when reading the result:

  • The underlying value stays the same. Only its representation (the base and digits) changes.
  • The output always uses uppercase letters A–Z for digits 10 through 35.
  • If your input includes a leading - sign, the output will also include a leading minus sign.
  • If the input is 0, the output will also be 0 in any base.

For example:

  • Input 1011 with source base 2 and target base 10 yields 11.
  • Input 11 with source base 10 and target base 2 yields 1011.
  • Input -FF with source base 16 and target base 10 yields -255.

Worked Example: Hexadecimal to Binary and Decimal

Suppose you want to convert the hexadecimal number 2A3 (base 16) into binary (base 2) and decimal (base 10).

Step 1: Interpret 2A3 in Base 16

In hexadecimal, the digits have the following values:

  • 2 → 2
  • A → 10
  • 3 → 3

From left to right, 2A3 means:

2 × 162 + 10 × 161 + 3 × 160

Compute each part:

  • 2 × 162 = 2 × 256 = 512
  • 10 × 161 = 10 × 16 = 160
  • 3 × 160 = 3 × 1 = 3

Add them together:

512 + 160 + 3 = 675.

So 2A316 = 67510.

Step 2: Convert 675 to Binary

Now convert the decimal integer 675 to base 2. One common method is to divide by 2 repeatedly and track remainders:

  • 675 ÷ 2 = 337 remainder 1
  • 337 ÷ 2 = 168 remainder 1
  • 168 ÷ 2 = 84 remainder 0
  • 84 ÷ 2 = 42 remainder 0
  • 42 ÷ 2 = 21 remainder 0
  • 21 ÷ 2 = 10 remainder 1
  • 10 ÷ 2 = 5 remainder 0
  • 5 ÷ 2 = 2 remainder 1
  • 2 ÷ 2 = 1 remainder 0
  • 1 ÷ 2 = 0 remainder 1

Reading the remainders from last to first, you get:

1010100011.

So 67510 = 10101000112, and therefore 2A316 = 10101000112.

Comparison Table: One Value in Several Bases

The table below shows the same integer written in several common bases. This can help you spot patterns and verify that the converter is giving you consistent answers.

Base System Representation of 255
2 Binary 11111111
8 Octal 377
10 Decimal 255
16 Hexadecimal FF
36 Base-36 73

No matter which base you choose, each row describes the same underlying integer: 255.

Limitations and Assumptions

To keep the converter reliable and easy to use, it makes several assumptions and has a few limitations:

  • Integers only: The tool is designed for whole numbers. It does not handle fractional parts or decimal points (such as 3.14 or 101.101).
  • Base range 2–36: You must choose bases between 2 and 36 inclusive. Bases like 1 (unary) and bases above 36 are not supported.
  • Valid characters: Only digits 0–9 and letters A–Z are allowed. Any other characters will be treated as invalid and may trigger an error message or be rejected.
  • Case-insensitive letters: Input letters can be lowercase or uppercase, but the output will always use uppercase letters.
  • Digit limits by base: All digits in the input must be valid for the chosen base. For example, the digit 8 is not allowed in base 8, and the digit G is not allowed in base 16.
  • Negative numbers: Negative integers are supported using a leading minus sign (for example, -1011 or -FF).
  • Very large integers: Extremely long numbers may be limited by your browser or device. Most typical use cases in programming and problem solving are well within safe limits, but astronomically large inputs can cause slowdowns or overflow.
  • No arithmetic: The converter does not add, subtract, multiply, or divide numbers. It only changes the base representation of the integer you provide.
  • Browser-based implementation: All conversions are performed in your browser using JavaScript. Once the page is loaded, no internet connection is needed for the calculations themselves.

As long as you stay within these assumptions—integer inputs, valid digits for the chosen base, and bases from 2 to 36—you can use this calculator to reliably convert between binary, octal, decimal, hexadecimal, base-36, and any other base in that range.

Paste an integer using digits 0-9 and letters A-Z. Negative numbers start with a minus sign.

Enter the radix of your original number. Common values include 2, 8, 10, and 16.

Choose the target radix. The converter formats the answer using upper case letters for digits above nine.

Enter a number, choose bases, and convert.

Embed this calculator

Copy and paste the HTML below to add the Base-N Number Converter to your website.