Number Base Converter

How do I convert number bases?

Result

255
11111111
377
FF

How it is calculated

Choose the base of the number you are typing (2, 8, 10 or 16) and the tool shows it in all four bases at once. It first reads the number in its own base to get a plain integer, then writes that integer in binary (digits 0-1), octal (0-7), decimal (0-9) and hexadecimal (0-9 and A-F). In any base the value is Σ digit × baseposition, counting positions from 0 on the right.

Only non-negative whole numbers are supported: no minus sign, fraction or prefix such as 0x or 0b. If a character is not a valid digit for the chosen base (for example 9 in binary, or G in hex) the tool reports an invalid number instead. Hex letters can be typed in upper or lower case, and the output uses capitals.

Worked example

Convert decimal 255. Binary: 255 = 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1, so every one of the 8 bits is set and the binary form is 11111111. Octal groups the bits in threes (11 111 111), giving 377. Hexadecimal groups them in fours (1111 1111), and each group is F, giving FF. The decimal value stays 255.

Try this example →

Common mistakes

  • Leaving the input base on decimal while typing a binary or hex value; 101 means one hundred and one in decimal but 5 in binary.
  • Typing a prefix like 0xFF or 0b1010. Enter only the digits, FF or 1010.
  • Entering a negative number or one with a decimal point; only non-negative integers are converted.
  • Confusing the letter O with zero, or a lowercase l with one, in hex and binary input.

About this calculator

This tool converts a number between the four bases most commonly used in computing and mathematics — binary (base 2), octal (base 8), decimal (base 10) and hexadecimal (base 16) — by interpreting the input in its source base and re-expressing the same value using each target base's digit set. Binary uses only 0 and 1, hex extends beyond 9 into the letters A–F, and the calculator handles the underlying place-value math automatically in either direction.

Programmers and computer science students use base conversion constantly, since computers store data in binary at the hardware level but binary numbers become unreadably long, so hexadecimal is used as compact shorthand in memory addresses, color codes and low-level debugging, while octal still appears in older systems and file permission notation. Anyone learning how computers represent numbers internally, or needing to manually check a hex or binary value against its decimal equivalent, relies on a converter like this rather than doing the place-value arithmetic by hand.

Was this helpful?

You can pick up to 3 reactions.

Comments (0)

  • Be the first to comment.

Popular calculators

All Calculators