Number Base Converter

Convert a number between binary, octal, decimal and hexadecimal, or any base from 2 to 36. Very large numbers work too.

Updated September 2026 Formulas tested

Quick answer: A number base is how many digits a system uses before it carries to the next place. Decimal is base 10, binary base 2, octal base 8 and hexadecimal base 16. The decimal number 255 is 1111 1111 in binary, 377 in octal and FF in hexadecimal.

Computers store numbers in binary, programmers often read them in hexadecimal, and older Unix permissions use octal. Moving between these by hand is slow and error-prone, so this tool converts a number to all the common bases at once.

Type a number, choose the base it is written in, and the binary, octal, decimal and hexadecimal versions appear straight away. There is also a fifth box for any other base from 2 to 36, and the tool handles numbers far larger than a normal calculator can.

How number bases work

In base 10 each digit is worth ten times the one to its right. In base 2 each digit is worth two times the one to its right, so 1101 means 1×8 + 1×4 + 0×2 + 1×1 = 13. Hexadecimal (base 16) uses the digits 0 to 9 and the letters A to F for 10 to 15, and one hex digit equals exactly four binary digits, which is why programmers like it.

Binary 1101 = 1×2³ + 1×2² + 0×2¹ + 1×2⁰ = 13
Hex 2F = 2×16¹ + 15×16⁰ = 47
To convert from decimal: divide by the base repeatedly and read the remainders backwards

Bases above 10 use letters for digits, so base 36 uses 0 to 9 and A to Z. Prefixes such as 0x (hex), 0b (binary) and 0o (octal) are accepted, spaces and underscores are ignored, and a leading minus sign is kept. Binary output is grouped in fours for easy reading.

A worked example

Example. The decimal number 255 is 1111 1111 in binary, 377 in octal and FF in hexadecimal. In the other direction, the hex color channel 1A is 26 in decimal.

Numbers in four bases

DecimalBinaryOctalHex
0000
1111
21022
31133
410044
510155
611066
711177
81000108
91001119
10101012A
11101113B
12110014C
13110115D
14111016E
15111117F
16100002010
25511111111377FF
256100000000400100

One hex digit stands for exactly four binary digits, which is why programmers write bytes and colors in hex.

Common mistakes to avoid

  • Reading a hex number as decimal. 10 in hex is 16, so always note the base, for example with the prefix 0x.
  • Dropping leading zeros in fixed-width values. Bytes and color codes are usually written with a set number of digits, such as 0A rather than A.
  • Entering a digit that is not allowed in the base. Binary allows only 0 and 1, and octal stops at 7.

Frequently asked questions

How do I convert binary to decimal?

Give each digit a value that doubles from right to left (1, 2, 4, 8, …) and add up the ones where the digit is 1. For 1101 that is 8 + 4 + 1 = 13. Or type the binary number here and read the decimal box.

Why do programmers use hexadecimal?

One hex digit matches exactly four bits, so a byte is always two hex digits. It is much shorter and easier to read than binary.

Is there a limit on the size of the number?

No practical limit. The tool uses exact big-integer arithmetic, so numbers with hundreds of digits convert without rounding errors.

Can it convert fractions or decimals like 10.5?

Not here. This tool converts whole numbers (integers). It will tell you if a character is not valid in the base you chose.

People also search for this as: binary to decimal converter, decimal to binary, hex to decimal converter, decimal to hexadecimal, octal converter, base converter.

Sources and further reading

Formulas on this page are checked by automated tests against independent references. See how we test our tools.

Press Esc to close