Skip to content
ToolzKit

Data & Conversion

Number Base Converter

Convert integers between binary, octal, decimal, hex and any base 2-36, exactly, using BigInt.

Number

Prefixes 0x, 0b, 0o are auto-detected

Detected input base is shown alongside the example, then binary, octal, decimal, hex and your chosen target base are all computed at once using BigInt for exact precision on huge integers.

About the Number Base Converter

Convert whole numbers between number bases from 2 to 36 at once. The input base can be auto-detected from common prefixes (0x, 0b, 0o) or chosen explicitly, and every calculation uses JavaScript's BigInt so results stay exact even for very large integers that would lose precision as ordinary numbers.

How to use it

  1. 01Type a number, optionally with a 0x, 0b or 0o prefix, or select an explicit input base.
  2. 02Choose a target base for the extra custom conversion, from 2 to 36.
  3. 03Read the simultaneous binary, octal, decimal, hexadecimal and target-base results.

Features

  • Auto-detection of 0x, 0b and 0o prefixes
  • Any input and target base from 2 to 36
  • Simultaneous binary, octal, decimal and hex outputs
  • BigInt arithmetic for exact results with arbitrarily large integers
  • Negative number support

Practical examples

Debugging bit flags

Convert a decimal permission value to binary to see which flags are set.

Reading hex color or memory values

Convert a hexadecimal address or color code to decimal for further calculation.

Limitations

  • Only integers are supported — fractional values are not handled.
  • Bases outside the 2-36 range aren't supported because that's the limit of the standard digit alphabet (0-9, a-z).

Privacy

All arithmetic runs locally in your browser using native BigInt; nothing is transmitted.

Read the full privacy policy for how the site as a whole handles data.

Frequently asked questions

Why use BigInt instead of parseInt?

Ordinary JavaScript numbers lose precision above 2^53; BigInt keeps arbitrarily large integers exact.

How does auto-detection work?

It checks for a 0x, 0b or 0o prefix (case-insensitive) and picks base 16, 2 or 8 respectively, defaulting to base 10 otherwise.

Can I convert negative numbers?

Yes, a leading minus sign is preserved through the conversion.