UltraConvert
Converters

Number Base Converter

Convert any integer between binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16). Backed by JavaScript's BigInt for arbitrarily large integers — handle numbers far beyond JavaScript's safe-integer limit of 9,007,199,254,740,991. Bidirectional editing means changing any field instantly updates all others.

What does this tool do?

The Number Base Converter provides bidirectional conversion between the four most common number bases used in computing and digital systems. It accepts numbers in any of the four bases and instantly displays equivalent values in the other three. Using BigInt internally, it handles numbers with thousands of digits without precision loss. The interface accepts common input formats including prefixes (0b for binary, 0o for octal, 0x for hex) and underscore separators for readability.

How it works

Input values are parsed using BigInt with automatic radix detection from prefixes (0b, 0o, 0x) or from the input field context. The BigInt value is then converted to each output base using toString(radix). Binary uses base 2 with digits 0-1. Octal uses base 8 with digits 0-7. Decimal uses base 10 with digits 0-9. Hexadecimal uses base 16 with digits 0-9 and a-f. Invalid characters for a given base are detected and rejected with clear feedback. The bidirectional binding means editing any field immediately recalculates and updates all other fields.

Features

How to use

  1. 1

    Enter a number

    Type into any of the four fields using that base's valid digits. The other three fields update instantly with converted values.

  2. 2

    Use prefixes for clarity

    Enter 0b1010 for binary, 0o755 for octal, 0xFF for hex. The tool recognizes and strips these standard prefixes automatically.

  3. 3

    Add underscores for readability

    JavaScript BigInt allows underscores as digit separators: 1_000_000 or 0xFF_FF. These are accepted and processed correctly.

  4. 4

    Copy any format

    Click the copy button next to any field to copy that base representation to your clipboard for use in code, documentation, or calculations.

Common use cases

Programming and debugging

Convert between hex color codes, binary bitmasks, decimal constants, and octal file permissions while coding or debugging.

Digital logic design

Electrical engineers and students convert between binary (logic levels), hex (compact representation), and decimal (human-readable) for circuit design.

Cryptocurrency and blockchain

Work with hex addresses, convert wei to ether denominations, and handle large integers common in blockchain applications.

Computer science education

Students learning number systems can verify their manual conversions and explore how large numbers behave across different bases.

Tips & best practices

Frequently asked questions

What's the maximum number size?
Effectively unlimited — BigInt handles thousands of digits before performance becomes noticeable. Your browser's memory is the practical limit.
Why does my input turn red?
It contains characters invalid for that base. Binary only accepts 0-1; octal 0-7; decimal 0-9; hex 0-9 and a-f. The other fields keep their last valid values while you correct the error.
Does it handle fractional numbers?
No — this tool is for integers only. For floating-point conversion between bases, you need a more specialized calculator that handles fractional parts separately.
What's the 0x prefix mean?
0x indicates hexadecimal in C, JavaScript, Python, and many languages. 0b indicates binary, 0o indicates octal. These are standard prefixes for number literals in most programming languages.

Related tools