Base Converter

Binary, octal, decimal and hex, all at once.

Options
Every base

Examples

Questions

How does it know which base my input is in?

From the prefix, as in most programming languages: 0x for hex, 0o for octal, 0b for binary. No prefix means decimal, so "10" is ten. Write 0b10 or 0o10 if you mean something else.

Is there a size limit?

No. Numbers are converted with BigInt, so a 100-digit number converts exactly. Normal JavaScript numbers lose precision above 2^53.

How are negative numbers shown?

As a minus sign and the digits, like a calculator. Tick "Two's complement" to also see how an 8, 16, 32 or 64-bit integer stores it, where -1 is all ones.

Can I use underscores, like 1_000_000?

Yes. Underscores are removed before converting, the same grouping JavaScript allows in number literals.