Number Base Converter

This number base converter turns a whole number from any base between 2 and 36 into binary, octal, decimal, hexadecimal and a base of your choice, with no rounding on large values.

Letters in the result

Whole numbers only, from base 2 to base 36, negative numbers allowed.

Type a number. Try ff in base 16 or 255 in base 10.

Why use this number base converter

Exact for big numbers

It uses whole-number arithmetic with no rounding, so a 20 digit value converts without losing digits.

Every common base at once

Binary, octal, decimal and hex update as you type.

Mistakes are located

A digit that does not belong to the base is reported by position.

What a number base converter does

A number base, or radix, is how many digits a positional numeral system uses. Base 10 uses 0 to 9, base 2 uses 0 and 1, and base 16 adds the letters a to f for 10 to 15. This tool reads a whole number in the base you pick and writes it in the others with whole-number arithmetic, so the result is exact at any size up to the input limit.

It converts whole numbers only. A decimal point or comma is refused with its position, and bases above 36 are not offered because the digits 0 to 9 and the letters a to z give only 36 symbols. To convert text instead of a number, use the binary text converter or the hex encoder and decoder.

Reading the tool

  • NumberType the digits in the From base. Letters a to z mean 10 to 35, and capitals work too.
  • From baseA list from 2 to 36. The default is 10.
  • Negative numbersA leading minus or plus sign is accepted. A negative number keeps its minus sign in every result.
  • Spaces and underscoresThey are ignored inside the number, so 1111 0000 and 1_000 both work.
  • Prefixes0x, 0b and 0o are accepted only when they match the From base. In base 10 the x is reported as an invalid digit.
  • Upper and LowerSwitch the letters in the results between capitals and lowercase. Upper is the default.
  • Custom baseAny base from 2 to 36 for the last result. The default is 3.
  • Division stepsShow the repeated division by the custom base. Only the first 100 steps are listed for a long result, with the true count.
  • ZeroLeading zeros are dropped, and -0 is shown as 0.

Common Use Cases

Worked example

255 in base 10 is 11111111 in binary, 377 in octal, ff in hex and 73 in base 36. The number -255 is -ff in hex.

Large values

18446744073709551616 is 10000000000000000 in hex. In base 36, 100000000000000000000 is l3r41ifs0q5ts.

Programmers

Read a hex value as decimal, or write a decimal value as a bit pattern.

Students

Check homework on positional numbers and repeated division.

How to convert a number between bases

1

Enter the number

Type or paste it in the Number box.

2

Choose the From base

Pick the base the number is written in. Base 10 is the default.

3

Read and copy the results

Binary, octal, decimal, hex and base 36 update as you type. Press Copy under the one you need.

4

Pick a custom base

Choose the base for the last result and tick Show division steps to see how it is built.

Benefits

Exact at any size

Numbers up to 5,000 characters convert without losing a digit.

Errors you can find

The message names the digit, its position and the digits the base allows.

Works from the keyboard

Every control is a labelled field, list or button, so the page works without a mouse.

Tips

  • •Check the base first. The same digits mean different numbers in different bases: 10 is 2 in base 2, 8 in base 8 and 16 in base 16.
  • •Fractions. Convert the part before the point here. Fractions are not supported.
  • •Letter O is not zero. In base 36 the letter o is the digit 24, so check that you typed a zero.
  • •The limit. Input over 5,000 characters, counted as code points, is refused before anything is converted.
  • •Need text or codes? Use the binary text converter for text, or the ASCII table to look up a character code.

Convert a number now

Type ff, choose base 16 and read 255 in decimal. Then change the custom base and open the division steps to see how 45 becomes 101101 in base 2.

To write a number out in words, try the number to words converter. To order a list of numbers, use the number sorter.

Related tools

Frequently Asked Questions

How do I convert a number to another base?

Type it in the Number box, choose the base it is written in, and read the results. Each one updates as you type.

Can it convert fractions?

No. It converts whole numbers only. A decimal point or comma is refused, and the message gives its position.

How big a number can I convert?

Up to 5,000 characters. Longer input is refused before any conversion, and the result is exact because it uses whole-number arithmetic.

Why only bases 2 to 36?

The digits 0 to 9 and the letters a to z make 36 symbols. Bases above 36 have no agreed digits, so they are not offered.

How are negative numbers shown?

With a minus sign in every base, for example -ff. The tool does not show two’s complement.

What does invalid digit at position mean?

The position counts every character you typed, including a sign, spaces and underscores. The message also lists the digits that base allows.

How do the division steps work?

Divide the number by the base, note the remainder, and repeat with the quotient until it is 0. The remainders, read from the bottom up, are the result: 45 in base 2 gives 101101.