Number base converter — any base from 2 to 36, fractions included

Type a number, its base and the base you want, and get the exact conversion, including fractional parts with repeating digits in brackets, plus the same value in binary, octal, decimal, hex and base 36.

Live demo · real result from this tool
Digits 0–9 and A–Z, with an optional point for fractions.
0.1 (base 10) in base 20.0(0011)

In common bases

BaseValue
Binary (2)0.0(0011)
Octal (8)0.0(6314)
Decimal (10)0.1
Hexadecimal (16)0.1(9)
Base 360.3(L)

Digits in brackets repeat forever: this fraction has no finite expansion in the target base.

Processed on your device — nothing is uploaded.

How to use the number base converter

  1. Type the value in Number. You may include a minus sign and one point, such as 0.1 or -1A.F.
  2. Set From base, the base the number is written in (2 to 36).
  3. Set To base, the base you want. The swap button next to the base fields reverses the direction.
  4. Read the converted value at the top, and the In common bases table for binary (in groups of 4), octal, decimal, hex and base 36.

What it does and when to use it

Computers store numbers in binary, programmers write them in hex, and maths courses ask for conversions between any two bases. Most converters only handle whole numbers. This one also converts fractions exactly and shows when a fraction repeats in the new base, which is the key to understanding floating-point rounding.

For arithmetic directly in base 2, use the binary calculator. To write a repeating decimal as a fraction, try the decimal to fraction converter. The scientific notation converter handles powers of ten.

How it works

The input is read digit by digit into an exact fraction: each digit is worth a power of the From base. For example, 777 in base 8 is 7 × 64 + 7 × 8 + 7 = 511.

To write the value in the new base:

  • Whole part: divide by the base again and again; the remainders, read from last to first, are the digits.
  • Fractional part: multiply by the base again and again; the whole-number part of each product is the next digit. If a remainder comes back that was seen before, the digits from that point repeat, and the tool puts them in brackets.

Step by step: 0.1 (base 10) to base 2.

Step Multiply by 2 Digit Left over
1 0.1 × 2 = 0.2 0 0.2
2 0.2 × 2 = 0.4 0 0.4
3 0.4 × 2 = 0.8 0 0.8
4 0.8 × 2 = 1.6 1 0.6
5 0.6 × 2 = 1.2 1 0.2

At step 5 the left-over 0.2 has been seen before (after step 1), so digits 2 to 5 repeat: 0.0(0011).

For a whole number, 255 to hex: 255 ÷ 16 = 15 remainder 15 (F), then 15 ÷ 16 = 0 remainder 15 (F). Reading the remainders upward gives FF.

Worked examples

A decimal fraction in binary. 0.1 (base 10) in base 2: 0.0(0011). The table also shows 0.1(9) in hex.

Decimal to hex. 255 (base 10) in base 16: FF, which is 1111 1111 in binary.

Octal to decimal. 777 (base 8) in base 10: 511.

A negative number. -5 converts to -101 in binary, and the two’s complement table shows 8-bit | 1111 1011.

Limits and tips

  • Bases must be whole numbers from 2 to 36.
  • Only one point is allowed; commas are not accepted as separators.
  • Conversions run in your browser, with nothing uploaded.

Frequently asked questions

What do the brackets in 0.0(0011) mean?
The digits inside the brackets repeat forever, so 0.0(0011) is 0.000110011001100… This is why 0.1 cannot be stored exactly in binary, and why 0.1 + 0.2 is not exactly 0.3 in most programming languages.
Which digits can I use above base 10?
Letters stand for 10 and up, so A = 10, B = 11 … Z = 35. Upper or lower case both work. A digit that is too large for the base, such as 9 in octal, gives a message listing the valid digits.
Can I paste 0x, 0b or 0o prefixes?
Yes, when the prefix matches the From base. 0xFF with From base 16 is read as FF. Spaces and underscores used as separators are ignored.
How are negative numbers handled?
A minus sign is kept in front of the result. For negative whole numbers the tool also shows the two's complement bit patterns for 8, 16, 32 and 64 bits, or says the number does not fit.
How many fractional digits are shown?
Up to 60. A repeating pattern is shown in brackets as soon as it is found. If a fraction neither ends nor repeats within 60 digits, the result ends with … and a note says it was cut off.

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close