Skip to main content

Number Base Converter

Convert integers exactly between binary, octal, decimal, hex and any base from 2 to 36

Number Input

Integers only, up to 100,000 characters. (0)

Options

From

Common base

To

Common base

Output format

Letter case
Advanced
Group separator

Output

Enter an integer or load an example.

Enter an integer or load an example.

How to Use

  1. 1.Type or paste an integer and pick the source base, or leave it on Auto to read 0b, 0o and 0x prefixes.
  2. 2.Pick the target base: the result updates as you type, next to binary, octal, decimal and hex with bit and byte length.
  3. 3.Choose uppercase or lowercase letters and a prefix, and under Advanced set digit grouping, separators, padding or a two's complement width.
  4. 4.Copy or download the result, or Swap to convert it back.

Number Base Converter

Convert integers exactly between binary, octal, decimal, hexadecimal and any base from 2 to 36. Values are held as BigInt, so 64-bit, 128-bit and 4096-bit numbers keep every digit, unlike tools that round above 2^53.

Rules and Limits

Integers only: fractions and exponents are rejected. Invalid digits are reported with their position and nothing is partly converted. A prefix must match the source base. Separators (_ or a single space) must sit between digits. -0 becomes 0 and leading zeros are dropped unless you pad. Input is limited to 100,000 characters, is processed in your browser and may be saved in browser storage; clear site data to remove it.

Frequently asked questions
Is the conversion exact for very large numbers?
Yes. Input digits are validated and accumulated into a JavaScript BigInt, and output uses exact radix conversion, so 64-bit, 128-bit and 4096-bit integers round-trip without losing digits. Tools that rely on Number or parseInt round values above 2^53.
How does Auto detect the base?
Auto only looks for a 0b (binary), 0o (octal) or 0x (hex) prefix after an optional sign. Without a prefix the value is read as decimal. The tool never guesses a base from the digits themselves, so ff in Auto mode is an error rather than hex.
Can I convert fractions or negative numbers?
Negative integers are supported with a leading - and keep their sign in every base; an optional two's complement view shows 8- to 128-bit patterns. Fractional input is rejected with the position of the decimal point because base conversion of fractions is not exact in general.

CodingTool is officially live on