Number Base Converter for Programmers and Students

Convert numbers between decimal, binary, octal, and hexadecimal instantly.

Frequently asked questions

Which number bases are supported?

Decimal (base 10), binary (base 2), octal (base 8), and hexadecimal (base 16).

What happens if I type an invalid digit for a base?

A message names the problem, and the other fields keep their last valid values until you correct the entry, so check for the error message before trusting them.

Can it convert negative numbers or fractions?

No. Only whole numbers from zero upward are accepted, and a minus sign or decimal point triggers the invalid-number message. Two's complement and floating-point formats are not shown.

How do I convert binary 1010 to decimal?

Type 1010 in the Binary field and read the Decimal field, which shows 10. Each binary digit is worth a power of two, so 1010 is 8 + 0 + 2 + 0.

What is the largest number I can convert reliably?

9,007,199,254,740,991, which is 2 to the power 53 minus 1. Past that point the value is rounded to the nearest number JavaScript can store, so the digits may be wrong.

Why does hexadecimal use letters?

Hexadecimal has 16 digits but we only have ten numerals, so A to F stand for 10 to 15. FF is therefore 15 x 16 + 15, which is 255.