Number Base Converter - Convert Between Any Bases from 2 to 36

AdSense Placeholder
Slot: header_tool

Number Base Converter

Binary, octal, decimal, hex and any base up to 36, exactly

--
Binary (2)
Octal (8)
Decimal (10)
Hexadecimal (16)
Base 36 (36)
Bit length of the integer part: --

AdSense Placeholder
Slot: tool_mid_article

Any Base 2 to 36

Convert from and to any base, with the common ones (2, 8, 10, 16, 36) always shown.

No Size Limit

Big integers are exact: no rounding at 2^53 like ordinary JavaScript numbers.

Exact Fractions

Repeating digits are detected and shown in brackets, e.g. 0.1 = 0.0(0011) in binary.

Private

Everything runs in your browser; nothing you paste is uploaded.

How Base Conversion Works

In base b, each digit is worth b times the one to its right: 2F in hexadecimal is 2 × 16 + 15 = 47. Bases above 10 use letters for the extra digits (A = 10 up to Z = 35). Prefixes 0b, 0o and 0x are accepted for binary, octal and hex, and spaces or underscores used to group digits are ignored. Every whole number has an exact representation in every base.

Fractions are different: a fraction terminates in a base only if its denominator's prime factors divide the base. That is why 0.1 in decimal repeats forever in binary, 0.0(0011), which is the root of the classic 0.1 + 0.2 ≠ 0.3 floating-point surprise. This converter works with exact rational arithmetic and marks the repeating block in brackets, or shows … if it is longer than the digit limit.

Key Takeaways

  • Prefixes welcome: 0x, 0b and 0o are understood.
  • Exact, any size: Integers use BigInt arithmetic.
  • Repeating digits: Brackets mark the block that repeats forever.
AdSense Placeholder
Slot: footer_leaderboard