Number Base Converter

Binary, octal, decimal, hex and any base from 2 to 36 at once — exact for very large numbers, with fractions and a two's complement reading.

Value to convert

Type a whole number or one with a point — 1010.11 in binary works too.

Input is in base 10

Prefixes are optional — 0x1F, 0b1011 and 0o17 are all accepted when the matching base is selected.

In base 2

Binary (base 2)
Octal (base 8)
Decimal (base 10)
Hexadecimal (base 16)
Base 2
Bit length
Storage
Two’s complement reading
As a character

Whole numbers convert exactly at any size — there is no 32-bit ceiling. Fractions are carried to about 14 significant places.

What a number base actually is

A base is simply how many digits you count with before rolling over into a new column. Base 10 uses 0–9, so 255 means 2 hundreds, 5 tens and 5 ones. Base 2 uses only 0 and 1, so the same quantity is written 11111111 — eight columns worth 128, 64, 32, 16, 8, 4, 2 and 1. Base 16 uses 0–9 then A–F, so 255 becomes FF. The quantity never changes; only the notation does.

Why hexadecimal is everywhere in computing

One hex digit maps exactly onto four binary digits, so a byte is always two hex characters and nothing has to be worked out to translate between them. That is why colours are written #FF8800, why memory addresses look like 0x7FFE, and why hex dumps line up neatly in columns. Octal groups binary in threes instead, which is why Unix file permissions read 755.

Two’s complement and the width you choose

Computers store negative whole numbers by fixing a width and treating the top bit as a sign. In 8 bits, 11111111 is 255 if the value is unsigned and −1 if it is signed. Pick a register width above and this converter shows both readings, which is usually what you want when a value looks impossibly large — a signed 32-bit −1 shows up as 4294967295 when read unsigned.

Fractions in other bases

Digits after the point work the same way, with each column worth a further division by the base. Binary 0.11 is one half plus one quarter, or 0.75. Some tidy decimals do not end in binary — 0.1 in base 10 repeats forever in base 2, which is the root of most floating-point rounding surprises.

Related calculators

The quickest sanity check when a conversion looks wrong is to count columns. Read a binary number right to left, doubling as you go — 1, 2, 4, 8, 16 — and add the columns holding a 1. For hexadecimal, split the binary into groups of four from the right and translate each group on its own; the grouping shown above is there for exactly that. If a hex value has an odd number of digits, pad it with a leading zero before reading it as bytes, since storage always comes in whole bytes.

Two things trip people up more than the arithmetic. The first is case and prefixes: 0x1F, 1F and 1f are the same value, and the prefix only tells a compiler which base to assume — this converter accepts it or ignores it either way. The second is width. A value has no inherent size, so "is this negative?" is not a question about the number but about the register holding it, which is why the width selector exists rather than being guessed for you.

Frequently asked questions

How do I convert decimal to binary by hand?
Divide by 2 repeatedly and keep the remainders, then read them bottom to top. 13 ÷ 2 = 6 r1, 6 ÷ 2 = 3 r0, 3 ÷ 2 = 1 r1, 1 ÷ 2 = 0 r1, giving 1101. The other direction is easier: double along the columns and add the ones — 8 + 4 + 1 = 13.
Why does hexadecimal use letters?
Base 16 needs sixteen distinct digits, and we only have ten numerals, so A–F stand in for 10–15. F is 15, so FF is 15 × 16 + 15 = 255 — the largest value a single byte can hold.
What does the register width setting change?
It decides how a value is read as a signed number. The same bits mean different things at different widths: 11111111 is −1 as a signed 8-bit value but 255 unsigned, and 65535 if the same bits sit in a 16-bit register. Leave it on “not fixed” if you only want the plain positive value.
Can this handle very large numbers?
Yes. Whole numbers are converted digit by digit rather than through a floating-point value, so there is no 32-bit or 53-bit ceiling and long hex or binary strings stay exact. Fractional parts are carried to roughly 14 significant places.
Which bases are supported?
Any base from 2 to 36, using 0–9 then A–Z as digits. Binary, octal, decimal and hexadecimal have quick buttons because they cover almost all practical work, but base 12, base 32 and base 36 are all available in the dropdowns.
Does it accept 0x, 0b and 0o prefixes?
Yes, as long as the matching base is selected — 0x1F in base 16, 0b1011 in base 2 and 0o17 in base 8 are all read correctly, and spaces or underscores used as separators are ignored.

Last reviewed · How ListCalc calculates · Report an error