Developer Tools Number Systems Binary Hexadecimal Tutorial

Free Online Number Base Converter — Binary, Octal, Decimal, Hex & Any Base

· 7 min read

Developers constantly switch between number bases. You read a memory address in hexadecimal, configure a Unix permission mask in octal, debug a bitfield in binary, and store IDs in decimal. Converting between these bases should be instant, accurate, and effortless. Our free Online Number Base Converter handles binary, octal, decimal, hexadecimal, and any custom base from 2 to 36 — with support for arbitrarily large integers via native BigInt.

Type or paste a number, select its base, and the tool instantly converts it to every other common base. All computation happens in your browser. No server, no upload, no data retention. It even supports numbers with hundreds of digits that would break ordinary floating-point converters.

Why Number Base Conversion Matters

Computers operate in binary. Humans prefer decimal. Systems programmers need hexadecimal. Unix veterans reach for octal. The ability to move fluently between these representations is a fundamental skill in software engineering, and a practical necessity in many day-to-day tasks:

  • Memory addresses and pointers: Debuggers display addresses in hex. Converting between hex and decimal helps you understand offset calculations and memory layout
  • Color values: CSS uses hex (#ff3b00), image processing libraries may use decimal RGB, and bitwise operations often require understanding the binary representation of each channel
  • File permissions: Unix chmod uses octal (644, 755). Understanding how those digits encode read/write/execute bits for owner, group, and others requires binary thinking
  • Network protocols: IP addresses, port numbers, checksums, and packet headers frequently appear in hex dumps. Converting hex to decimal helps verify field values
  • Bitwise operations: Flags, masks, and bitfields are designed in binary and often documented in hex. Converting between representations helps you verify that your OR, AND, and shift operations produce the intended result
  • Embedded systems: Register maps, pin configurations, and hardware addresses are documented in hex or binary. Decimal-oriented thinking leads to errors
  • Cryptography: Keys, hashes, and encoded data are universally represented in hex or Base64. Verifying a SHA-256 hash means comparing 64 hex characters
  • Competitive programming: Problems involving number theory, combinatorics, or custom numeral systems often require conversion between arbitrary bases

Without a reliable converter, you are left with mental arithmetic (error-prone for large numbers), command-line tools (requires a terminal and memorized syntax), or search engines (slow, inconsistent, and often ad-ridden). An online base converter fills the gap: zero setup, instant feedback, and accurate results for numbers of any size.

What Our Number Base Converter Does

All Standard Bases

The tool provides dedicated output cards for the four most common number bases:

  • Binary (base 2): The native language of digital logic. Essential for bitwise operations, flag checking, and understanding how data is physically stored
  • Octal (base 8): Compact representation of binary data in groups of three bits. Still used in Unix file permissions and some legacy systems
  • Decimal (base 10): The number system humans use daily. Useful when you need to communicate a numeric value to non-technical stakeholders or verify arithmetic
  • Hexadecimal (base 16): The standard representation for memory addresses, color codes, and binary data. Each hex digit maps cleanly to four binary bits

Custom Base Support (2–36)

Beyond the standard bases, the tool supports any custom base from 2 to 36. Bases up to 36 use the digits 0–9 and letters a–z as needed. This is particularly useful for:

  • Base 36 encoding: A compact way to encode large integers using alphanumeric characters, popular for short URL generation and unique identifiers
  • Base 32 and Base 64 variants: While true Base64 includes symbols, base-36 and base-62 subsets are used when only alphanumeric characters are allowed
  • Mathematical exploration: Understanding how numbers are represented in non-standard bases builds intuition for positional numeral systems

BigInt Support for Arbitrarily Large Integers

Most online converters use JavaScript's standard Number type, which can only represent integers exactly up to 2^53 (about 9 quadrillion). Beyond that, precision is lost. Our converter uses native JavaScript BigInt, which supports integers of unlimited size — limited only by your browser's memory.

This means you can convert numbers like 123456789012345678901234567890 accurately, without silent rounding errors. For cryptography, number theory, and systems programming, this precision is non-negotiable.

Multi-Line Input

Paste a list of numbers — one per line — and the tool converts every line simultaneously. Each output card displays the converted values on separate lines, preserving your original ordering. This is invaluable when processing register dumps, log files, or data exports containing multiple values.

Real-Time Conversion

As you type, all outputs update instantly. There is no "Convert" button to click. The tool parses your input on every keystroke, validates it against the selected base, and recomputes all target bases. Invalid characters are caught immediately with a clear error message.

One-Click Copy

Hover over any output card and a "Copy" button appears. Click it to copy the result to your clipboard. A green "Copied" confirmation appears for 1.5 seconds. Copy individual results or select and copy the entire multi-line output.

Common Use Cases for Number Base Conversion

  • Debugging memory dumps: A crash report shows a fault address in hex. Convert it to decimal to cross-reference with array indices or size calculations
  • Verifying checksums: A download page lists an MD5 hash in hex. You have the decimal equivalent from another source. Convert and compare
  • Configuring Unix permissions: You need 755 permissions. Convert 7 to binary (111) and 5 to binary (101) to understand exactly which read/write/execute bits are set
  • CSS color debugging: A designer gave you rgb(255, 59, 0). Convert each channel to hex to get #ff3b00 for your stylesheet
  • Network packet inspection: Wireshark displays packet lengths and port numbers in hex. Convert to decimal to verify against protocol specifications
  • Bitfield flag decoding: A status register reads 0b10110100. Convert to hex (0xb4) or decimal (180) for documentation, or inspect individual bits by reading the binary representation
  • Database ID inspection: MongoDB ObjectIds are hex strings. Converting timestamp portions to decimal helps you understand when a document was created
  • Teaching computer science: Students learning about positional numeral systems need a reliable way to check their manual conversions between bases

How to Use the Number Base Converter: Step by Step

  1. Open the tool: Go to Online Number Base Converter
  2. Enter your number: Type or paste the number you want to convert into the input field. You can enter multiple numbers, one per line
  3. Select the source base: Use the dropdown to choose Binary (2), Octal (8), Decimal (10), Hexadecimal (16), or enter a custom base manually
  4. Review the outputs: The tool instantly displays the converted values in Binary, Octal, Decimal, and Hexadecimal cards
  5. Set a custom base: Enter any base from 2 to 36 in the Custom Base field to see an additional conversion
  6. Copy results: Hover over any output card and click "Copy" to copy that result to your clipboard

Understanding the Algorithm: A Technical Deep Dive

The converter implements arbitrary-base arithmetic using JavaScript's native BigInt type. BigInt represents integers with arbitrary precision, unlike the standard Number type which is a 64-bit IEEE 754 float with only 53 bits of integer precision.

Parsing: From Any Base to BigInt

To parse a number from an arbitrary base, the tool iterates through each character left to right, maintaining a running total:

result = 0
for each character in input:
    digit_value = value_of(character)  // 0-9 → 0-9, a-z → 10-35
    result = result × base + digit_value

With BigInt, this becomes:

let result = 0n;
for (const char of input) {
    const digit = digits.indexOf(char);
    result = result × BigInt(base) + BigInt(digit);
}

This algorithm is O(n) where n is the number of digits — optimal for base conversion.

Encoding: From BigInt to Any Base

To convert a BigInt to an arbitrary base, the tool repeatedly divides by the target base and prepends the remainder:

while value > 0:
    remainder = value mod base
    output = digits[remainder] + output
    value = value ÷ base

With BigInt:

while (value > 0n) {
    const rem = Number(value % BigInt(base));
    result = digits[rem] + result;
    value = value / BigInt(base);
}

This is also O(n) in the number of output digits. Because BigInt division and modulo operate on arbitrary-precision integers, there is no precision loss regardless of the input size.

Why BigInt Matters

JavaScript's Number.MAX_SAFE_INTEGER is 9,007,199,254,740,991 (2^53 - 1). Any integer larger than this cannot be represented exactly. For example:

Number(12345678901234567890)  // → 12345678901234567000 (wrong!)
BigInt(12345678901234567890n) // → 12345678901234567890n (exact)

For cryptographic hashes (SHA-256 produces a 256-bit number), UUIDs (128-bit), and large sequential IDs, standard JavaScript numbers are inadequate. BigInt solves this natively, without external libraries.

Frequently Asked Questions

Is this base converter free?

Yes, completely free. No signup, no usage limits, no ads. Use it as much as you need.

Does this tool upload my numbers to a server?

No. All conversion happens 100% client-side in your browser. Your numbers never leave your device.

What is the largest number this converter can handle?

Thanks to native BigInt support, there is no practical limit beyond your browser's available memory. You can convert numbers with hundreds or even thousands of digits.

Can I convert multiple numbers at once?

Yes. Enter one number per line, and the tool converts every line simultaneously. Each output card shows the results on separate lines.

Does it support negative numbers?

Yes. Enter a number with a leading minus sign, and the tool preserves the sign across all target bases.

What bases are supported?

Any base from 2 to 36. Bases up to 10 use digits 0–9. Bases 11–36 add lowercase letters a–z. The tool provides quick-select options for binary (2), octal (8), decimal (10), and hexadecimal (16).

Does it work on mobile?

Yes. The tool is fully responsive. On small screens, the input and output panels stack vertically, and output cards remain readable and copyable.

Can I copy the results?

Yes. Hover over any output card and click the "Copy" button. The result is copied to your clipboard as plain text.

Try It Now

No signup, no upload, no server calls. Open Online Number Base Converter, enter a number, and see every base conversion instantly.

Looking for more free developer tools? Browse our full tools directory — including Online Diff Tool, Color Converter, CSV to JSON Converter, and Regex Tester.

Found this useful? Check out our free developer tools or browse more articles.