Number base converter

Type a number and see it in binary, octal, decimal and hexadecimal at the same time, plus any base from 2 to 36. Everything is worked out with exact integer arithmetic, so a sixty-four bit value keeps every digit: paste FFFFFFFFFFFFFFFF into most converters and the answer comes back as 18446744073709552000, which is not the number and carries no warning. The part after the point is converted digit by digit rather than through a float, so 0.1 in base ten reaches base three with everything it is entitled to, and a fraction that repeats is labelled instead of quietly rounded.

Frequently asked questions

Is my number sent anywhere?

No. The conversion happens in this tab as you type. The site’s security policy sets connect-src ‘none’, so the browser blocks network requests from these pages, meaning it could not be sent even if the code tried.

Why does this exist when JavaScript has parseInt?

Because parseInt stops being correct at about nine quadrillion and does not say so. Ask it for FFFFFFFFFFFFFFFF and it returns 18446744073709552000; the answer is 18446744073709551615. The difference is 385, arriving silently, in the one case a person converting hexadecimal is most likely to have in front of them. Everything here uses arbitrary-precision integers, so there is no size at which it starts guessing.

Why is 0.1 in binary not exact?

For the same reason a third is not exact in decimal: the base has no way to write it. A tenth is 0.0001100110011… in base two, repeating forever, which is also why adding 0.1 and 0.2 in most programming languages gives 0.30000000000000004. This page tells you when a fraction repeats rather than rounding it off and letting you think it terminated.

What is the signed reading underneath?

The same bits mean two different numbers depending on whether whatever produced them treated the top bit as a sign. 0xFFFFFFFF is 4,294,967,295 as an unsigned value and -1 as a signed one, and which is correct depends entirely on the program that wrote it. Both are shown because a hex dump does not say which you are looking at.

Can I paste 0x, 0b or spaces?

Yes. Prefixes are accepted when they agree with the base you chose and refused when they do not, because reading 0xFF as a decimal number would silently produce nonsense. Spaces, commas and underscores are ignored wherever they appear, so a value grouped for readability pastes straight in.

Why does the base stop at 36?

Because there are ten digits and twenty-six letters, and after that there is no agreement about what the next symbol should be. Base 64 exists and is a different thing entirely: it encodes bytes rather than writing a number, which is what the Base64 tool on this site is for.