Number Base Converter

Convert numbers between binary, octal, decimal, and hexadecimal in real time. Type in any field and the others update instantly. Supports bit grouping, case toggling for hex, and arbitrary-precision integers via <code>BigInt</code>.

How to Use This Tool

  1. Type in any field — enter a number in decimal, hexadecimal, octal, or binary.
  2. Watch it convert — the other three fields update automatically as you type.
  3. Toggle formatting — enable bit grouping to break binary into 4-bit nibbles, or switch hex case.
  4. Prefixes are OK — you can type 0x, 0b, or 0o prefixes; they will be recognised and stripped automatically.
  5. Handles huge numbers — conversion uses BigInt, so values well beyond 64 bits work without precision loss.

Number Bases at a Glance

A base (or radix) is the number of unique digits used to represent values in a positional number system. The base determines how much each column contributes: base 10 uses powers of 10 (1, 10, 100, 1000), base 2 uses powers of 2 (1, 2, 4, 8), and base 16 uses powers of 16 (1, 16, 256, 4096).

Binary (base 2) is the internal language of computers. All data — text, images, code — is stored as sequences of 0s and 1s. While humans rarely read raw binary, understanding it is essential for low-level programming, bitwise operations, and network protocols.

Hexadecimal (base 16) is the most common shorthand for binary because each hex digit represents exactly four binary digits. A single byte (8 bits) is written as two hex digits, from 00 to FF. You will see hex in memory addresses, hash outputs (like MD5 and SHA-256), MAC addresses, and CSS color codes.

Octal (base 8) is less common today but still appears in Unix file permissions (chmod 755) and some legacy systems. Each octal digit represents three binary digits.

Common Conversions

Frequently Asked Questions

What is the difference between binary, octal, decimal, and hexadecimal?
They are all positional number systems with different bases. Binary (base 2) uses two digits (0, 1) and is how computers store numbers internally. Octal (base 8) uses digits 0-7 and was common in older systems. Decimal (base 10) uses 0-9 and is the everyday human system. Hexadecimal (base 16) uses 0-9 and A-F, and compactly represents binary data — each hex digit corresponds to exactly four binary digits.
Why is hexadecimal used so often in programming?
Hexadecimal is a natural shorthand for binary because each hex digit maps cleanly to four binary digits (a nibble). A single byte takes exactly two hex digits (00 to FF), making it far more compact and readable than the eight-digit binary equivalent. This is why hex is used for memory addresses, color codes, MAC addresses, and hash output.
How do you convert a decimal number to binary?
Divide the decimal number by 2 repeatedly and record each remainder. Read the remainders bottom-up to get the binary representation. For example, 13 divided by 2 gives 6 remainder 1, then 3 remainder 0, then 1 remainder 1, then 0 remainder 1 — producing 1101. This tool performs the conversion automatically, but it is useful to understand the underlying algorithm.
What does 0x mean before a number?
The 0x prefix indicates a hexadecimal literal in C, C++, JavaScript, Python, and most other programming languages. For example, 0xFF equals 255 in decimal. Similarly, 0b indicates binary (0b1111 = 15) and 0o indicates octal (0o17 = 15) in many languages.
What is two's complement and when is it used?
Two's complement is a way to represent signed integers in binary. To negate a number, invert all bits and add 1 — this makes addition work the same for positive and negative numbers without special hardware. Almost all modern CPUs use two's complement for signed integer arithmetic. It is why the range of a signed 32-bit integer is -2,147,483,648 to 2,147,483,647 rather than symmetric around zero.