Number Base Converter

Convert numbers between binary, octal, decimal, and hexadecimal instantly. Enter a value in any base and see all four forms at once, with digit validation.

Responsive Leaderboard Ad (728x90)
Only digits valid for the chosen base
 
All Four Bases at Once
Decimal value
-
-
Binary
-
Octal
-
Decimal
-
Hexadecimal
Responsive Content Banner (728x90 / 300x250)

How to Use the Number Base Converter

Computers, programmers, and electronics engineers constantly switch between number bases: binary for hardware, octal for older systems and file permissions, decimal for everyday arithmetic, and hexadecimal as a compact shorthand for binary. This converter takes a number in any one of those four bases and instantly shows all four values at once, so you never have to convert twice or wonder whether a digit is legal in the base you chose.

  1. Type your numberEnter the value in the first box, for example 255, 1010, or FF. Whole non-negative numbers only; signs and decimal points are not part of these integer bases.
  2. Tell the converter which base it is inChoose binary, octal, decimal, or hexadecimal from the dropdown. This matters: 1010 means ten in binary but one thousand and ten in decimal.
  3. Press Convert and read all four resultsThe binary, octal, decimal, and hexadecimal values appear together, with the decimal value highlighted, so you can copy whichever form your code or homework needs.
  4. If an error appears, check your digitsEach base allows only certain digits. Binary allows only 0 and 1, so 102 is rejected; octal allows 0 to 7, so 89 is rejected; hexadecimal allows 0 to 9 and A to F, so G is rejected.

What Is a Number Base, and Why Do We Have More Than One?

A number base, also called a radix, is simply how many distinct digits a counting system uses before it carries over to a new place. Decimal, the system we learn as children, uses ten digits (0 to 9) because humans have ten fingers. Each position is worth ten times the one to its right: in 255, the digits mean 2 hundreds + 5 tens + 5 ones. Binary uses only two digits, 0 and 1, because computer hardware is built from switches that are either off or on. Each binary position is worth twice the one to its right, so 1010 means 8 + 0 + 2 + 0 = 10. Octal uses eight digits, 0 to 7, and hexadecimal uses sixteen: 0 to 9 plus the letters A to F for the values ten to fifteen.

Hexadecimal exists mainly as a convenience for humans reading binary. One hexadecimal digit corresponds to exactly four binary digits, so a long binary string like 11111111 collapses neatly into FF. That is why you see hexadecimal everywhere in computing: color codes on the web such as #FF5733 are really three hexadecimal bytes for red, green, and blue; memory addresses are shown in hex; and network engineers read device addresses in hex. Octal played a similar role in early computing, when machines used word sizes divisible by three bits, and it still appears in Unix file permissions, where a value like 755 encodes read, write, and execute rights for owner, group, and others.

BaseDigits allowedExampleDecimal value
Binary (2)0, 111111111255
Octal (8)0 to 7377255
Decimal (10)0 to 9255255
Hexadecimal (16)0 to 9, A to FFF255

Converting by Hand: Two Worked Examples

Converting binary to decimal by hand teaches the place-value idea better than any definition. Take 101101. Reading from the right, the positions are worth 1, 2, 4, 8, 16, and 32. The digits are 1, 0, 1, 1, 0, 1 from the right, so the value is 1 + 4 + 8 + 32 = 45. Converting decimal to binary goes the other way: repeatedly divide by 2 and record the remainders. For 45, the remainders are 1, 0, 1, 1, 0, 1, and reading them backwards gives 101101, confirming the first conversion. Hexadecimal works the same way with powers of sixteen: 1A3 means 1 times 256, plus A (10) times 16, plus 3, which is 256 + 160 + 3 = 419.

A quick shortcut connects binary, octal, and hexadecimal without passing through decimal. Group binary digits in threes from the right for octal, or in fours for hexadecimal, then convert each group. For example, 101011110 becomes 101 011 110 in octal groups, which is 5 3 6, and 1 0101 1110 in hexadecimal groups, which is 1 5 E, so the value is 536 in octal and 15E in hexadecimal. Students often make two mistakes here: forgetting to pad the leftmost group with leading zeros, and reading groups from the left instead of the right. Both change the answer, so always start grouping at the rightmost digit.

Practical Tips and Common Mistakes

First, always state the base when sharing a number that could be ambiguous: writing 1010 alone does not tell anyone whether you mean ten or one thousand and ten, which is why programmers write prefixes such as 0b1010 for binary and 0xFF for hexadecimal. Second, remember that leading zeros do not change a value, so 0001010 in binary is still ten; they are often added purely to pad a number to a neat width, such as eight bits. Third, this converter handles whole numbers only. Fractions in other bases, negative numbers, and extremely long inputs beyond 64 digits are outside its scope, and the converter will tell you so rather than guessing. Finally, everything runs in your browser with no data sent anywhere, so you can convert homework answers, code constants, and permission values privately and as often as you like.

Frequently Asked Questions (FAQs)

What is 255 in binary, octal, and hexadecimal?
255 in binary is 11111111, in octal is 377, and in hexadecimal is FF. All four forms represent the same value; only the counting system changes.
Why does binary 102 give an error?
Binary uses only the digits 0 and 1, so the digit 2 is illegal in base 2. If you meant the decimal number one hundred and two, select decimal as the input base first.
What are hexadecimal letters A to F?
Hexadecimal needs sixteen digits, but we only have ten numerals, so the letters A to F stand for the values 10, 11, 12, 13, 14, and 15. That is why FF means 15 times 16 plus 15, which is 255.
How do I convert binary to hexadecimal quickly?
Group the binary digits in fours from the right, padding the leftmost group with zeros, then convert each group of four to one hex digit. For example, 11111111 groups as 1111 1111, which is F F.
Does this converter handle negative numbers or fractions?
No. It converts whole non-negative integers up to 64 digits. Negative numbers and fractions in other bases need a different representation, such as two's complement or a fractional point, which this tool does not cover.