piapia123
en

Number Base Converter (2 / 8 / 10 / 16 / 36)

Conversion

Everything runs locally in your browser — nothing is uploaded

Input
Output

Convert a number between binary, octal, decimal, hexadecimal and base 36, with all five results listed at once so you never have to switch dropdowns back and forth. The 0x, 0o and 0b prefixes are detected automatically, and underscores or spaces pasted from code are tolerated. Arithmetic uses BigInt rather than ordinary numbers — past 2^53 a double silently drops the tail digits, so a snowflake ID converts to something that looks right but is not, with no error raised.

Features

  • Binary, octal, decimal, hex and base 36 results all shown at once
  • Automatic prefix detection: 0x for hex, 0o for octal, 0b for binary
  • Exact for integers of any length — 19-digit snowflake IDs come out digit-for-digit
  • Reports the bit length and whether the value fits in a signed 64-bit integer
  • Underscores and spaces act as digit separators, so pasted literals work as-is
  • A prefix that contradicts the selected base is an error, not a silent guess
  • Fractions are refused outright — 0.1 is a repeating fraction in binary and has no exact answer

How to use

  1. Paste a number — a 0x / 0o / 0b prefix is detected automatically
  2. Pick the input base and the prefix / uppercase options if you need them
  3. All five bases appear at once
  4. Click Copy to take the result

FAQ

Why do large integers need special handling?
JavaScript numbers are double-precision floats: beyond 2^53 adjacent integers are no longer distinguishable, so 1234567890123456789 quietly becomes 1234567890123456800. That is exactly the size of snowflake IDs and auto-increment keys, so this tool uses BigInt throughout and never touches floating point.
Why is there no prefix on the base 36 result?
0x, 0o and 0b are the three prefixes JavaScript itself defines. Base 36 has no standard prefix, and inventing one would produce output that cannot be pasted back into code, so none is added.
Can it convert fractions?
No, and that is deliberate: 0.1 in decimal is a repeating fraction in binary, so any finite output would be an approximation. Practically every real conversion involves integers, so only integers are supported and fractions are rejected with an explanation.
What does "needs unsigned 64-bit" mean?
The value is above 2^63-1 and no longer fits a signed 64-bit integer. Databases distinguish signed and unsigned BIGINT columns, so check the column type before inserting or the value will overflow or be truncated.

Related tools