Skip to main content
Preparing workspace

Base Converter

Convert numbers and exact fractions between bases 2 to 36. Enter 22/7 or positional digits, see recurring expansions, and copy a conversion report.

Still loading. If the tool doesn’t appear, reload this page.

About this tool

Base Converter

Convert numbers between binary, octal, decimal, hex, and base36.

To change base, divide the number by the new base repeatedly and read the remainders from last to first: 255 in base 16 is 255 ÷ 16 = 15 r15, giving FF. Fractions go the other way, by repeated multiplication. This converter does both for bases 2 to 36, exactly, even for very long numbers.

How to use Base Converter

  1. Type the value into the Number field — the placeholder shows the accepted shapes (255, DEAD.BEEF, -1010.11…). Spaces, underscores and commas are ignored, and the input takes up to 4096 characters.

  2. Set Input base to the base the number is written in; the dropdown lists every base from Base 2 · Binary through Base 36.

  3. The results update as you type, listing Binary (0b), Octal (0o), Decimal, Hexadecimal (0x) and Base 36 together with the bit and byte length; use Extra base to show to add any other base from 2 to 36 to that list, and read the Grouped for reading and Fixed-width types it fits in tables below it.

  4. Drag the Fraction digits slider (0 to 60, default 20) to set how far a recurring fraction expands — anything cut short is marked …recurring. Then use Copy result to copy every conversion, or Reset to return to the defaults.

Why use Base Converter

  • Exact at any size

    BigInt arithmetic means a 200-digit integer converts without a single rounded digit.

  • Honest about fractions

    Marks an expansion that recurs and names its repeating block, and marks one that is merely cut off, instead of calling either exact.

  • Reduced fractions in each base

    Enter two integers separated by a slash and see the exact, simplified quotient in each output base.

  • Bit-width answers included

    Reports bit length, byte count, and whether the value fits an 8, 16, 32, 64 or 128-bit signed or unsigned type.

Common use cases

  • Turn 0xDEADBEEF into the decimal 3,735,928,559 and check it still fits in a 32-bit unsigned integer.
  • Show a class why 0.1 in decimal never terminates in binary, digit by digit.
  • Convert a 64-bit permission mask between binary and hexadecimal without losing the low bits to floating point.

Frequently asked questions

How do I convert decimal to binary by hand?

Divide by 2 repeatedly and read the remainders bottom to top. 255 ÷ 2 gives remainder 1 eight times in a row, so 255 is 11111111 in binary — 8 bits, which is exactly the largest value an unsigned 8-bit integer can hold.

Link to answer
Why is base 36 the highest base available?

Because the standard digit alphabet is 0-9 followed by A-Z, which is 10 + 26 = 36 symbols. Past that there is no agreed notation for the next digit, which is why JavaScript's own Number.toString has the same 36 limit.

Link to answer
Why does 0.1 in decimal never end in binary?

Because a fraction terminates in base b only when its denominator's prime factors all divide b. One tenth is 1/(2 × 5), and binary has only the factor 2, so the 5 never divides out and the block 0011 repeats forever after the first 0. At the default 20 fraction digits the tool shows 0.00011001100110011001 and marks it as recurring; the Fraction digits slider sets how many digits of the repeat are written out (digits are cut off, not rounded). The same fraction ends at once in base 10 (0.1) and in base 20 (0.2).

Link to answer
Can I convert an exact fraction between number bases?

Enter a numerator and a nonzero denominator separated by a slash. Both integers use the selected input base. For example, 1/3 in base 10 repeats in binary as 0.010101… and has the exact binary fraction 1/11. Open Exact fractions for the reduced result in each base.

Link to answer
What is the largest number this can convert?

Up to 4,096 characters of input, which is well past a 4,000-bit integer — far larger than any fixed-width type. There is no floating-point step anywhere in the conversion, so precision does not degrade as the number grows.

Link to answer
How do I convert hexadecimal to decimal?

Multiply each hex digit by its power of 16 and add them up. FF is 15 × 16 + 15 = 255, and DEADBEEF comes to 3735928559, which needs 32 bits. Set the source base to 16, type the digits (a 0x prefix is accepted) and the decimal value appears alongside binary, octal and base 36.

Link to answer

Embed this tool on your site

Add the Base Converter widget to your blog or website — free, responsive, no signup. Just keep the “Widget by AltFTool” credit link visible.

<iframe src="https://www.altftool.com/embed/widget/base-converter"
  title="Base Converter — free AltFTool widget"
  width="100%" height="640" style="border:0;border-radius:12px;overflow:hidden"
  loading="lazy" referrerpolicy="no-referrer-when-downgrade" allow="clipboard-write"></iframe>
<p style="font-size:12px;margin:4px 0 0">Widget by <a href="https://www.altftool.com/tools/all/base-converter?utm_source=embed&utm_medium=widget" rel="nofollow">AltFTool — free online tools</a></p>

Browse all embeddable widgets →