Skip to content

Number Base Converter

Convert integers between binary, octal, decimal & hex

Privacy: your files never leave your device. All processing happens locally in your browser.

How to use

  1. 1.Type the whole number you want to convert into the value field — letters are case-insensitive and a leading minus sign is allowed.
  2. 2.Choose the 'from base' that your number is written in (for example Binary for 1010), then pick the 'to base' you want the answer in.
  3. 3.Read the converted result instantly, along with the value shown in all four common bases — binary, octal, decimal, and hexadecimal — at once.

About Number Base Converter

A number base converter changes a whole number from one numeral system (its base, or radix) into another — binary to decimal, hex to decimal, decimal to binary, octal to hex, or any base from 2 to 36 — instantly and entirely in your browser, with nothing uploaded. The two settings that matter are the 'from base', which decides how your input is read, and the 'to base', which decides how the answer is written; the same digits mean completely different values depending on which base you pick.

A base is just how many distinct digits a system uses and what each position is worth. Decimal (base 10) uses digits 0–9, and each position is a power of ten, so 255 means 2×100 + 5×10 + 5×1. Binary (base 2) uses only 0 and 1, with positions worth 1, 2, 4, 8, 16…, so 1010 in binary is 8 + 0 + 2 + 0 = 10 in decimal. Octal (base 8) uses 0–7, and hexadecimal (base 16) uses 0–9 then A–F for the values ten through fifteen, which is why FF in hex equals 255 in decimal. Bases above ten simply keep borrowing letters, all the way to base 36 (0–9 and A–Z).

These systems are everywhere in computing. Binary is the native language of hardware because a bit is either off or on. Hexadecimal is the compact human shorthand for binary — each hex digit maps to exactly four bits — so programmers use it for memory addresses, byte values, CSS colors like #FF8800, MAC addresses, and hash digests. Octal still shows up in Unix file permissions (chmod 755). Being able to convert between binary, octal, decimal, and hex quickly is a daily task in low-level programming, networking, debugging, and digital electronics.

Converting by hand uses two classic methods. To go from another base into decimal, multiply each digit by its place value and add them up (positional expansion). To go from decimal into another base, repeatedly divide by the target base and read the remainders from bottom to top. This tool does both for you the moment you type, and also shows the result in all four common bases at once so you never have to run the calculation twice.

Unlike a naive converter, this one validates every character strictly: if you type a digit that is not legal for the chosen base — say the digit 2 in a binary number, or the letter G in hex — it tells you instead of silently dropping it and returning a wrong answer. It handles a leading minus sign, treats letters case-insensitively (FF equals ff), and uses arbitrary-precision arithmetic (BigInt) so even numbers far larger than a normal computer integer convert exactly, with no rounding or overflow. Everything runs client-side, so your numbers never leave your device.

Frequently asked questions

How do I convert binary to decimal?
Multiply each binary digit by its place value (…8, 4, 2, 1) and add them up. For example 1010 in binary is (1×8) + (0×4) + (1×2) + (0×1) = 10 in decimal. Set the from base to Binary and the to base to Decimal and this converter does it instantly.
How do I convert hex to decimal?
Hexadecimal is base 16, using 0–9 then A–F for ten through fifteen. Multiply each digit by a power of 16 and add: FF is (15×16) + (15×1) = 255 in decimal. Pick Hexadecimal as the from base and Decimal as the to base to convert automatically.
What is the difference between binary, octal, decimal, and hex?
They differ only in how many digits they use: binary (base 2) uses 0–1, octal (base 8) uses 0–7, decimal (base 10) uses 0–9, and hexadecimal (base 16) uses 0–9 plus A–F. The same value looks different in each — decimal 255 is 11111111 in binary, 377 in octal, and FF in hex.
Why do I get an error when I enter a number?
Every digit must be legal for the base you chose. Binary allows only 0 and 1, so 102 is invalid in binary because 2 is not a binary digit; hex allows 0–9 and A–F, so G is invalid. The tool flags the exact bad character instead of silently returning a wrong result, which many converters do.
Can it convert very large numbers or decimals?
It converts whole numbers of any size exactly, because it uses arbitrary-precision (BigInt) arithmetic rather than a fixed-size integer, so it will not overflow or lose precision. Fractions and decimal points are not supported — base conversion of fractional values is a separate, more complex operation, so this tool focuses on integers.

Calculators guides

View all