Skip to main content

Free Number Base Converter

Convert numbers between binary, octal, decimal, and hexadecimal. See bit-size fit and grouped binary output instantly.

Works offline once loaded
Input base:

Quick values

Common uses

  • Convert Numbers for ProgrammingConvert between binary, octal, decimal, and hex while writing code β€” instant reference for any number.
  • Convert Numbers for NetworkingConvert subnet masks, port numbers, and IP address octets between binary and decimal.
  • Number Systems for Computer ScienceLearn and verify binary, octal, hex conversions β€” perfect for CS students and exam prep.
  • Inspect Bit Patterns and FlagsConvert numbers to binary to inspect individual bits, bitmasks, and flag combinations.
  • Decode Hex Dumps and Debug LogsDecode hexadecimal values from crash reports, memory dumps, and debug logs into readable decimal.

How It Works

Conversion runs entirely in your browser using JavaScript's built-in BigInt type β€” no library, no server. BigInt is used instead of the older parseInt/Number approach specifically to handle values larger than 2^53 without rounding errors.

  1. 1
    Input parsing with BigInt
    A custom parser strips optional prefixes (0x, 0b, 0o, #) and validates the character set for the chosen base, then passes the cleaned string to the BigInt() constructor, which handles arbitrarily large integers losslessly.
  2. 2
    Simultaneous base conversion
    Once the BigInt value is known, the tool calls BigInt.prototype.toString() with each radix (2, 8, 10, 16, and a user-chosen base from 2–36) to produce all output representations in a single pass β€” no intermediate decimal step required.
  3. 3
    Binary grouping and bit-width check
    Binary output is padded to a multiple of 4 and split into nibble groups for readability. The tool also checks whether the value fits inside 4-, 8-, 16-, or 32-bit signed/unsigned ranges using BigInt arithmetic, so overflow behavior is exact even for 32-bit boundaries.
  4. 4
    Shareable URL state
    After each valid conversion the tool writes the input and source base to the URL fragment (#v=&from=) via history.replaceState, so the current conversion can be bookmarked or shared β€” the fragment is never sent to any server.

Related Tools

Frequently Asked Questions