Number Base Converter

Enter a number and see it in binary, octal, decimal, hexadecimal, base 32 and base 36 together. Whole numbers of any practical size are handled exactly. The converter is free, runs in your browser and never uploads what you type.

Number Base ConverterPrivate · runs on your device
Input
Words 0Characters 0Lines 0
All bases

Example: 255 → Binary 1111 1111, octal 377, hexadecimal FF

How to use the number base converter

Type one number per line and each one gets its own block of results, so you can convert a whole list in one go.

  1. Enter your numbers in the input box, one per line. Spaces, commas and underscores inside a number are ignored, so 1_000 and 1,000 read as one thousand.
  2. Choose Input base. Auto reads the prefixes 0x (hexadecimal), 0b (binary) and 0o (octal), and treats anything else as decimal. Or fix the base yourself: Binary (2), Octal (8), Decimal (10), Hexadecimal (16), Base 32 or Base 36.
  3. Read the block under each number: Binary grouped in fours, Octal, Decimal, Hexadecimal in capitals, Base 32 and Base 36.
  4. If a digit does not belong in the chosen base, the line names it, for example that 9 is not a valid digit in base 8, and the other lines still convert.

How the conversion works

Every base is positional: each digit is multiplied by a power of the base and the products are added. Take 255. In hexadecimal, FF means 15 × 16 + 15 = 255. In octal, 377 means 3 × 64 + 7 × 8 + 7 = 255. In binary, 1111 1111 is 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255. Going the other way, you divide repeatedly by the target base and read the remainders from last to first.

InputRead asResult
255decimalbinary 1111 1111, octal 377, hexadecimal FF, base 32 7V, base 36 73
0xFFhexadecimaldecimal 255
0b1010binarydecimal 10
18446744073709551616decimal (2 to the power 64)hexadecimal 10000000000000000

Base 32 and base 36 follow the same rule with a longer digit set. In base 36 the letters stand for the values 10 to 35, so Z is 35. The number 255 equals 7 × 36 + 3, which is why it is written 73. That is a handy cross-check when you want to confirm a result by hand.

The last row shows why exact integer arithmetic matters: a number that large cannot be held precisely in an ordinary floating-point value, but this tool keeps every digit.

Where each base is used

Binary shows what the hardware stores, and grouping in fours makes it line up with hexadecimal, since one hex digit is exactly four bits. That is why bit masks, memory addresses and byte values are written in hex. Web colours are hex too: the pair FF in #FF8800 is 255 of red, which you can confirm with the Hexadecimal setting, or explore further in the colour picker.

Octal survives in Unix file permissions. The command chmod 755 uses the octal digits 7, 5, 5, which equal decimal 493 and binary 111 101 101. Enter 0o755 in Auto mode to see all three. Base 36 uses the digits 0-9 and then A-Z, which makes it a compact way to shorten numeric IDs. For text rather than numbers, the hex to text converter and the binary code translator translate bytes into readable characters, and the hash generator produces the long hex strings you may want to inspect.

Limits worth knowing

  • Whole numbers only. Fractions and floating-point values such as 0.5 or 1e3 are not accepted.
  • Negative numbers keep their minus sign, so -255 shows -FF. Two's complement, the fixed-width form that hardware uses for negatives, is not produced.
  • The input can be up to 200 digits long.
  • Base 32 here uses the digits 0-9 followed by A-V. This is not the A-Z and 2-7 alphabet used by the Base32 text encoding, so the two will not match.
  • Prefixes are only honoured when they agree with the base you chose. With Decimal selected, 0xFF is an error rather than 255.
  • Letters are case-insensitive on input, so ff, Ff and FF are the same hexadecimal number. Output letters are always capitals.

Because each line gets its own block, it is easy to compare related values side by side. Try 15, 16 and 255 with the Auto setting to see where a hexadecimal number gains an extra digit, or paste a column of byte values to check them against a datasheet. When a result looks wrong, first check the Input base: the same digits 101 mean 5 in binary, 65 in octal and 101 in decimal, so the setting changes the answer.

For written-out numbers rather than other bases, the number to words converter may be what you need.

Quick answers

Frequently asked questions

The questions people ask most, answered in plain words.

How do I convert decimal to binary?

Type the decimal number and leave the Input base on Auto or Decimal. The Binary line shows the answer grouped in fours, so 255 appears as 1111 1111. By hand, divide by 2 repeatedly and read the remainders from last to first, or add up the powers of two that fit.

What do the 0x, 0b and 0o prefixes mean?

They mark the base of a number. The prefix 0x means hexadecimal, 0b means binary and 0o means octal, so 0xFF is 255, 0b1010 is 10 and 0o755 is 493. Auto mode recognises them, and a number with no prefix is read as decimal.

How does the converter handle negative numbers?

A leading minus sign is kept and applied to every result, so -255 shows as -1111 1111 in binary and -FF in hexadecimal. It does not produce two's complement, the fixed-width form used inside processors, because that depends on a chosen number of bits.

Is base 32 here the same as Base32 encoding?

No. This converter writes numbers using the digits 0-9 and then A-V, which is the standard way of extending positional notation. The Base32 text encoding used in data formats has a different alphabet, A-Z and 2-7, and encodes bytes, so results will not match.

How large a number can I convert?

Whole numbers of up to 200 digits are converted exactly, because the tool uses arbitrary-precision integers instead of ordinary floating-point values. For example, 2 to the power 64 is 18446744073709551616 in decimal and 10000000000000000 in hexadecimal, with no rounding. Fractions are not supported.