# What is this number in another base?

Converts a whole number from any base from 2 to 36 into any other base, exactly at any size, and shows it in decimal, binary, octal and hexadecimal.

- Page: https://www.acalculator.org/logic/base-converter
- JSON spec: https://www.acalculator.org/logic/base-converter.json
- Version: 34f6eb7646fc

## Default answer

Example with the default inputs (Number 255, From base 10, To base 2): 255 in base 10 is 11111111 in base 2.

## Inputs

| Key | Label | Description |
| --- | --- | --- |
| n | Number | The whole number to convert, in its own base: the digits 0 to 9, then the letters A to Z for digits 10 to 35, with an optional minus sign. |
| from | From base | The base the number is written in. |
| to | To base | The base to write the number in. |

## Outputs

| Key | Label | Description |
| --- | --- | --- |
| result | Number in the new base | The number written in the "to" base, letters in capitals. |
| decimal | Decimal (base 10) | The number in base 10. |
| binary | Binary (base 2) | The number in base 2. |
| octal | Octal (base 8) | The number in base 8. |
| hex | Hexadecimal (base 16) | The number in base 16. |
| digits | Digits in the new base | How many digits the number has in the "to" base, not counting a minus sign. |

## Method

Value = Σ dᵢ × fromⁱ over the digits, right to left from i = 0; then the value is divided by the new base again and again, and the remainders, read last to first, are the new digits.

## Assumptions

- Whole numbers only: a point or fraction part is not read.
- Digits above 9 are the letters A to Z (A = 10, Z = 35), in capitals or small letters.
- Exact at any size: the page works in whole-number arithmetic, never in floating point.

## Worked examples

1. n = 255, from = 10, to = 2 gives result = 11111111, decimal = 255, octal = 377, hex = FF, digits = 8. Source: Wikipedia, "Positional notation" (a digit string dₖ…d₁d₀ in base b is Σ dᵢ × bⁱ), https://en.wikipedia.org/wiki/Positional_notation (retrieved 2026-10-05).
2. n = 1A3, from = 16, to = 10 gives result = 419, decimal = 419, binary = 110100011. Source: Wikipedia, "Positional notation" (a digit string dₖ…d₁d₀ in base b is Σ dᵢ × bⁱ), https://en.wikipedia.org/wiki/Positional_notation (retrieved 2026-10-05).
3. n = 2021, from = 3, to = 7 gives result = 115, decimal = 61. Source: Wikipedia, "Positional notation" (a digit string dₖ…d₁d₀ in base b is Σ dᵢ × bⁱ), https://en.wikipedia.org/wiki/Positional_notation (retrieved 2026-10-05).
4. n = -zz, from = 36, to = 10 gives result = −1295, decimal = -1,295. Source: Wikipedia, "Positional notation" (a digit string dₖ…d₁d₀ in base b is Σ dᵢ × bⁱ), https://en.wikipedia.org/wiki/Positional_notation (retrieved 2026-10-05).

## FAQ

### How do I convert a number from one base to another?

First find its value: multiply each digit by the base raised to its place (0 for the last digit, 1 for the one before, and so on) and add. Then divide that value by the new base again and again; the remainders, read from the last to the first, are the digits in the new base.

### What digits does a base above 10 use?

The digits 0 to 9 and then letters: A is 10, B is 11, and so on up to Z, which is 35. Base 16 uses 0 to 9 and A to F; base 36 uses all ten digits and all 26 letters. Capital and small letters mean the same.

### Why is 36 the largest base?

Ten digits and 26 letters give 36 symbols, so 36 is the largest base that can be written with them. Larger bases need other symbols, such as groups of decimal digits.

### What is 255 in binary and hex?

255 is 2⁸ − 1, so in binary it is eight ones, 11111111. In hex it is FF, because 15 × 16 + 15 = 255. In octal it is 377.

### Can I convert negative numbers?

Yes. Type a minus sign before the digits. The page converts the size of the number and keeps the sign, so −1295 in decimal is −ZZ in base 36. It does not write two’s complement; use the two’s complement calculator for that.

### Does it work with fractions?

No. The page converts whole numbers only. A fraction part often has no exact form in another base (0.1 in decimal repeats forever in binary), so it is left out.

## Sources

- Wikipedia, "Positional notation": a digit string in base b has the value Σ dᵢ × bⁱ, and conversion by repeated division. https://en.wikipedia.org/wiki/Positional_notation (retrieved 2026-10-05)
- Wikipedia, "Radix": bases and the digits 0 to 9 and A to Z. https://en.wikipedia.org/wiki/Radix (retrieved 2026-10-05)
