← Home

🔢 Number Base Converter

Convert between binary (base 2), octal (base 8), decimal (base 10) and hexadecimal (base 16) with full precision. Works with negatives and fractions.

What is this tool?

Number base conversion is the process of expressing the same quantity in different positional numeral systems. The decimal system we use every day is base 10, meaning each digit position represents a power of ten. Computers, however, work internally in binary (base 2), where each position is a power of two. Octal (base 8) and hexadecimal (base 16) are compact shorthand notations used widely in programming, memory addressing and digital electronics because each octal digit maps to exactly three binary bits and each hex digit to four. This converter translates any number between these four bases instantly. It handles very large integers without losing precision, supports negative values through the standard sign-magnitude convention, and even converts fractional parts with an adjustable number of digits. Just type a number, pick its base, choose the target base, and the result appears immediately. Because everything runs locally in your browser, there is no server round-trip — conversions are instant, private and work offline. Whether you are a student learning base arithmetic, a programmer debugging hex dumps, or a network engineer reading IP addresses and MAC addresses, this tool saves you from mental arithmetic and manual long division.

For related calculations, try the scientific notation calculator, the Roman numeral converter and the data storage converter to explore more useful tools.

How it works

The calculator converts through decimal as an intermediate step. First, the input number in its source base is expanded into a polynomial and evaluated to produce the decimal value: for example, the binary number 1011₂ equals 1×2³ + 0×2² + 1×2¹ + 1×2⁰ = 8 + 0 + 2 + 1 = 11. Then the decimal value is converted to the target base using repeated division: divide the number by the target base, record the remainder, and repeat until the quotient reaches zero; the remainders read in reverse order give the result. Fractional parts use the reverse process: multiply the fractional part by the target base, take the integer part as the next digit, and repeat. Because some fractions never terminate in certain bases (for example, 1/10 in binary is an infinite repeating expansion), the tool lets you choose how many fractional digits to compute, with a warning when the expansion does not terminate. A useful derived feature is the bit-length estimate: for any decimal value, the tool shows how many binary bits are needed to represent it, which is helpful when allocating fixed-width fields in protocols or hardware registers.

Binary Place Values

Each bit position in binary represents a power of two.

10110101128643216842110110101₂ = 128+32+16+4+1 = 181

Base Conversion Reference Table

Equivalent values of 0–15 in all four supported bases.

DecimalBinaryOctalHex
0000
1111
21022
31133
410044
510155
611066
711177
81000108
91001119
10101012A
11101113B
12110014C
13110115D
14111016E
15111117F

Common Bit Patterns Reference

Frequently used binary and hex values in computing.

DecimalBinaryHexTypical use
25511111111FFMax byte value, RGB component
2561000000001001 byte overflow, 2⁸
1024100000000004001 KiB in binary
409610000000000001000Page size on many systems
655351111111111111111FFFFMax 16-bit unsigned value
2147483647011111111111111111111111111111117FFFFFFFMax 32-bit signed int
Ad

How to use

  1. Enter the number you want to convert.
  2. Select the source base — binary, octal, decimal or hexadecimal.
  3. Select the target base.
  4. Press Convert to see the result.
  5. Adjust fractional digits if converting a decimal fraction.

Frequently Asked Questions

Why does the calculator convert through decimal?

Converting directly between arbitrary bases is possible but error-prone for humans. Passing through decimal as an intermediate step guarantees correctness for both integers and fractions, since decimal arithmetic is exact for the conversion process itself.

Does it support negative numbers?

Yes. Negative numbers are represented with a minus sign followed by the magnitude in the target base (sign-magnitude form). This differs from two's complement, which is a fixed-width representation used inside computer hardware.

How many digits can it handle?

The tool uses JavaScript's BigInt for integer parts, so it supports integers far beyond 2⁵³ with no loss of precision. Fractional parts are computed to a configurable number of digits.

What is two's complement and why is it not used here?

Two's complement is a way of representing negative integers in fixed-width binary (like 8-bit or 32-bit). It requires knowing the width in advance. This converter shows the simpler sign-magnitude form, which is unambiguous without a fixed width.

Why does 0.1 not convert cleanly to binary?

The decimal fraction 0.1 has an infinite repeating expansion in binary, just as 1/3 repeats in decimal (0.333...). The tool computes a limited number of digits and notes that the expansion does not terminate.

What bases are supported?

Binary (base 2), octal (base 8), decimal (base 10) and hexadecimal (base 16). These four cover the vast majority of programming, electronics and networking use cases.

Tips & Advice

Each hex digit maps to exactly four binary bits (0-F = 0000-1111), and each octal digit to three bits (0-7 = 000-111) — grouping binary digits into sets of four or three makes manual conversion much faster. Powers of two appear constantly: 2¹⁰ = 1024, which is why 1 KB equals 1024 bytes in binary notation. When converting negative numbers, remember that this tool uses a minus sign followed by the magnitude, not two's complement — two's complement is a fixed-width representation used inside computers. For fractional conversions, more target digits means more precision; binary often needs many digits to represent simple decimals like 0.1. Use hex for memory addresses and colour codes, octal for Unix file permissions, and binary when you need to reason about individual bits.

Related Tools

Sources & References

  1. NIST. Guide to the SI - Decimal and binary prefixes. physics.nist.gov.
  2. Wolfram MathWorld. Number Base. mathworld.wolfram.com.

Last reviewed: August 2026.

Limitations

This tool converts between positional numeral systems. It is designed for educational and programming use.

What this tool does not account for:

Always verify critical conversions with an independent method before relying on them.

Ad