Number Base Converter

Convert an integer between any two bases from 2 to 36 with arbitrary-precision arithmetic.

  • Runs locally in your browser
  • No upload required

Try it

Processed entirely in your browser; nothing is uploaded.

Result
FF

Supported formats

Input
text
Output
text

Privacy

Runs entirely in your browser. Your input is never uploaded, stored, or sent to a third party.

Processing
In your browser
Privacy level
Browser only

Converted 255 from base 10 to base 16, giving FF.

How it works

  • Read every digit of the input in base 10 and accumulated an exact integer.
  • Repeatedly divided by the target base and read the remainders to produce the target digits.
  • Rendered the result with the digits 0-9A-Z.
  • Arbitrary-precision arithmetic means values larger than 2^53 are converted exactly.

Methodology

  1. Validate the value as a signed integer and both bases as integers from 2 to 36.
  2. Accumulate the exact value by iterating the input digits, multiplying by the source base and adding each digit.
  3. Produce the target digits by repeated division with remainder, then restore the sign.

Usage

  1. Enter the integer to convert.
  2. Choose the source and target bases from 2 to 36.
  3. Read the converted result.

Examples

These are examples, not current values: they use fixed inputs, while the interactive tool computes live results in your browser.

Decimal to hexadecimal

jsonSelect to copy
{
  "value": "255",
  "fromBase": 10,
  "toBase": 16
}

Binary to decimal

jsonSelect to copy
{
  "value": "11111111",
  "fromBase": 2,
  "toBase": 10
}

Big integer stays exact

jsonSelect to copy
{
  "value": "123456789012345678901234567890",
  "fromBase": 10,
  "toBase": 16
}

Limitations

Positional notation

Every positional number system expresses a value as a sum of digits times a power of the base. Converting changes only the representation, never the value, which is why the result can be converted back exactly.

Frequently asked questions

Can it convert a very large number exactly?
Yes. The converter uses arbitrary-precision arithmetic, so a value such as 123456789012345678901234567890 is converted exactly rather than being rounded to a floating-point value.
Does it support negative numbers?
Yes. A leading minus sign is preserved and the magnitude is converted with the same rules.

Sources

  1. ECMA-262: ECMAScript Language Specification — TC39
  2. RFC 4648: The Base16, Base32, and Base64 Data Encodings — IETF
  3. Positional notation — Wikipedia — Wikipedia