What is this number in another base?
Type a whole number, the base it is written in, and the base you want. The base calculator rewrites it exactly, at any size, and also shows it in decimal, binary, octal and hex.
- Number in the new base
- 11111111
255 in base 10 is 11111111 in base 2.
- Decimal (base 10)
- 255
- Binary (base 2)
- 11111111
- Octal (base 8)
- 377
- Hexadecimal (base 16)
- FF
- Digits in the new base
- 8
Number in the new base: 11111111. 255 in base 10 is 11111111 in base 2.
How to calculate
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.
Example with the default inputs (Number 255, From base 10, To base 2): 255 in base 10 is 11111111 in base 2.
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.
- 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
Each example is checked against the calculator on every build.
- Number 255, From base 10, To base 2 gives Number in the new base 11111111, Decimal (base 10) 255, Octal (base 8) 377, Hexadecimal (base 16) FF, Digits in the new base 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)
- Number 1A3, From base 16, To base 10 gives Number in the new base 419, Decimal (base 10) 419, Binary (base 2) 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)
- Number 2021, From base 3, To base 7 gives Number in the new base 115, Decimal (base 10) 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)
- Number -zz, From base 36, To base 10 gives Number in the new base −1295, Decimal (base 10) -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)
How it works
A whole number written in base b with digits dₖ … d₁ d₀ (d₀ is the last digit) has the value
value = dₖ × bᵏ + … + d₁ × b + d₀
Each digit must be from 0 to b − 1. The digits above 9 are letters: A = 10, B = 11, …, Z = 35, in capitals or small letters.
To write the value in a new base B, divide it by B, keep the remainder as the last digit, and repeat with the whole quotient until it is 0. The remainders, read from the last to the first, are the digits in base B.
Rules
- Both bases are whole numbers from 2 to 36.
- The number may start with a minus sign (- or −) or a plus sign. An underscore between two digits is ignored (1111_0000); an underscore at the start or end, or two in a row, gives no answer, and so does a space inside the number. In base 10, commas may separate groups of three digits (1,048,576); any other comma gives no answer.
- A character that is not a digit of the "from" base gives no answer, with a message.
- Whole numbers only, exact at any size. A negative number is written as a minus sign and the digits of its size.
What the calculator shows
- Number in the new base: letters in capitals, with a minus sign (−) when negative.
- The same number in decimal, binary (base 2), octal (base 8) and hexadecimal (base 16).
- Digits in the new base: the count of digits, not counting the minus sign.
Worked examples by hand
255 from base 10 to base 2. 255 ÷ 2 = 127 r 1, 127 ÷ 2 = 63 r 1, 63 → 31 r 1, 31 → 15 r 1, 15 → 7 r 1, 7 → 3 r 1, 3 → 1 r 1, 1 → 0 r 1. Reading up: 11111111, 8 digits. In octal 255 = 3 × 64 + 7 × 8 + 7 = 377; in hex 15 × 16 + 15 = FF.
1A3 from base 16 to base 10. 1 × 16² + 10 × 16 + 3 = 256 + 160 + 3 = 419. In binary, 419 = 256 + 128 + 32 + 2 + 1 = 110100011.
2021 from base 3 to base 7. Value = 2 × 27 + 0 × 9 + 2 × 3 + 1 = 61. 61 ÷ 7 = 8 r 5, 8 ÷ 7 = 1 r 1, 1 ÷ 7 = 0 r 1. Reading up: 115.
−zz from base 36 to base 10. Z = 35, so zz = 35 × 36 + 35 = 1,295, and the number is −1295.
Other questions people ask
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.