Home / Math / Base Converter

Base Converter: Binary, Octal, Decimal, Hexadecimal and More

Type a number, say which base it is written in, and choose the base to convert to. Works for every base from 2 to 36, handles negatives and fractional digits, and lists the common bases too.

By Adzita Editorial Team · Updated 2026-11-03 · How we build and check our tools

Digits 0-9 then letters A-Z (case does not matter). A leading minus sign and one point are allowed.

How positional number systems work

In base b, each digit is worth a power of b. The rightmost integer digit is worth b0, the next b1, and so on. The decimal number 345 means 3×102 + 4×101 + 5×100. The binary number 1101 means 1×8 + 1×4 + 0×2 + 1×1 = 13. Digits to the right of the point continue downward: the first is worth b−1, the second b−2.

A base needs exactly b digit symbols. Binary uses 0 and 1, octal 0 to 7, hexadecimal 0 to 9 plus A to F, and base 36 uses every digit and every letter.

The conversion method used here

The tool first converts the input to an exact value, then rewrites it in the target base. For the integer part it divides repeatedly by the target base and collects the remainders from last to first. For 255 in base 2, the remainders run 1, 1, 1, 1, 1, 1, 1, 1, giving 11111111.

For the fractional part it multiplies by the target base and takes the whole-number part of the result as the next digit, repeating on the remainder. Fractions are held as exact ratios of integers, so no rounding error creeps in. Some fractions never terminate in the new base: 0.1 in decimal is 0.0001100110011... in binary, which is why computers store it only approximately. This page stops after 12 fractional digits and tells you when it has cut a fraction short.

Shortcuts between binary, octal and hex

Because 8 = 23 and 16 = 24, these bases map directly to binary. Group binary digits in threes from the point for octal, or in fours for hexadecimal. The binary number 1111 1111 is F F, so FF in hex. Going the other way, replace each hex digit with its four-bit group: A is 1010, 3 is 0011.

DecimalBinaryOctalHex
91001119
10101012A
15111117F
16100002010

Common mistakes and limits

Integers can be very long because the arithmetic uses arbitrary-precision integers, but the input is limited to 200 digits.

Worked example

Convert the binary number 1011.101 to decimal. The integer part is 11 and the fraction .101 is 5/8, so the answer is 11.625.

Inputs

Number1011.101
From base2
To base10

Result

11.625 (base 10)

1011.101 in base 2 equals 11.625 in base 10.

Binary (base 2)1011.101
Octal (base 8)13.5
Decimal (base 10)11.625
Hexadecimal (base 16)B.A

Accuracy note: Results use standard double-precision arithmetic, so very large or very small values may be rounded. Check important results by another method.

Frequently asked questions

How do I convert binary to decimal by hand?

Write the place values 1, 2, 4, 8 and so on from the right, then add the place values wherever the binary digit is 1. For example, 1101 is 8 + 4 + 1 = 13.

What do the letters mean in hexadecimal?

Hexadecimal needs sixteen symbols, so after 0 to 9 it uses A to F for the values ten to fifteen. This calculator extends the idea to Z for bases up to 36.

Is this the same as two's complement?

No. This converter treats a minus sign as a sign and writes the magnitude in the new base. Two's complement is a fixed-width way of storing negative values in hardware.

Why does a short decimal fraction become long in binary?

A fraction terminates in base b only if its denominator has prime factors found in b. Tenths involve a factor of 5, which binary lacks, so 0.1 repeats forever in binary.

What is the largest base supported?

Base 36, which uses the ten digits and the 26 letters of the Latin alphabet. Bases above that need extra symbols that have no standard form.

Roman Numeral ConverterConvert numbers 1 to 3999 to Roman numerals and back, with a breakdown of each symbol.Scientific Notation CalculatorConvert numbers to scientific, E and engineering notation, or back to a plain decimal.Percentage CalculatorPercent of a number, percent change, and increase or decrease by a percent, with working.Scientific CalculatorEvaluate typed expressions with trig, logs, roots, powers and factorials in degrees or radians.

References and sources

  1. Knuth, D. E. The Art of Computer Programming, Volume 2: Seminumerical Algorithms, section 4.1 on positional number systems.

Check primary sources for anything you rely on.