Number Base Converter — Binary, Octal, Decimal, Hex

Convert numbers between binary, octal, decimal, and hexadecimal in real time. Four live-synced fields with per-base validation.

6 chars
2 chars
2 chars
2 chars
Decimal value: 42

Edit any field and the other three update live. Binary accepts 0-1, octal 0-7, decimal 0-9, and hexadecimal 0-9 plus a-f. JavaScript safe-integer range applies: results above 2^53 - 1 may lose precision.

About Base Converter

A fast, client-side base converter for developers. Edit any of the four fields — binary, octal, decimal, or hex — and watch the others update instantly. Each field validates against its base, so an invalid digit lights up a red border immediately. Built for bit-level debugging, embedded work, and CTF problem solving, with no server round-trips.

Switching between number bases is part of daily work for anyone touching low-level code. Hex shows up in color values, memory addresses, and protocol headers. Binary is how you reason about flags, bitmasks, and permission bits. Octal still lingers in Unix file modes. This converter puts all four side by side so you can see the same value expressed four ways at once, which is much faster than running parseInt calls in a scratch terminal.

The math is straightforward: parseInt(value, radix) decodes, then toString(radix) re-encodes into the other three bases. Every field validates against its allowed character set (binary accepts only 0 and 1, octal 0-7, hex 0-9 plus a-f), and a red border appears the moment you type a character that does not belong. Because JavaScript numbers are 64-bit floats, results above 2^53 - 1 can lose precision. For anything smaller, conversions are exact and instantaneous.

How to use the Base Converter
  1. 1

    Type in any base

    Enter a value in any of the four fields. Invalid characters for that base trigger a red border and the others hold their previous value.

  2. 2

    Watch the other fields update

    Valid input is parsed to decimal then re-encoded into the other three bases. A badge shows the decimal value formatted with thousands separators for readability.

  3. 3

    Copy what you need

    Copy a single field or grab all four labelled values at once with Copy all. Clear wipes every field when you want to start fresh.

Common use cases

Debugging bitmask logic

Paste a decimal flag value to see its binary representation and spot which bits are set without doing the math.

Working with color codes

Convert a hex color channel to decimal to adjust RGB math, or flip decimal back to hex for CSS.

Reading hex dumps

Turn hex offsets into decimal file positions while reverse-engineering binary formats.

CTF and embedded work

Rapidly flip values between bases when decoding challenges or talking to an MCU register by hand.

Frequently asked questions
What is the largest number this supports?

Numbers up to Number.MAX_SAFE_INTEGER (2^53 - 1, or 9,007,199,254,740,991). Above that, JavaScript's double-precision floats start losing integer precision and results may be inaccurate.

Does it handle negative numbers?

Enter a minus sign in the decimal field to convert negative integers. The other bases render the negated absolute value; two's complement encoding depends on bit width, which is not assumed here.

Why does my hex input show a red border?

Hex only accepts 0-9 and a-f (case-insensitive). Characters like g or special symbols are invalid. Remove any 0x prefix — the tool accepts the digits only.

Is my input sent anywhere?

No. Conversion runs entirely in your browser using parseInt and toString. Nothing is uploaded or logged.

Can I paste a value with spaces or separators?

Leading and trailing whitespace is trimmed, but internal spaces or commas are treated as invalid characters. Paste the raw digits only.

developerconverterencoding