Base Converter

Convert numbers between binary, decimal, hexadecimal and octal instantly. Enter a value, pick the bases, get the result. No signup. Ideal for programmers and students.

Remove Ads
Remove Ads

Result

Result
Decimal value
Remove Ads

Share on Social Media:

A base converter translates a number between binary, decimal, hexadecimal and octal — 255 in decimal is 11111111 in binary, 377 in octal and FF in hex. Enter a value, pick the two bases, click Convert, and copy the result. It is free, with no signup, and it runs entirely in your browser.

On this page

  1. How to Convert Between Number Bases Step by Step
  2. What Number Bases Are and Why They Exist
  3. This Converter Versus Manual Base Conversion
  4. Who Uses a Base Converter
  5. Pro Tips for Working Across Number Bases
  6. Common Base Conversion Mistakes to Avoid
  7. Related Tools You May Need Next
  8. Frequently Asked Questions

How to Convert Between Number Bases Step by Step

  1. Enter your number. Type the value into the box above — for example “255”. Use only digits that are valid for its base: binary uses only 0 and 1.
  2. Select the source base. Choose the base your number is currently in: Binary (2), Octal (8), Decimal (10) or Hex (16).
  3. Select the target base. Choose the base you want the number converted into.
  4. Click “Convert”. The result appears under “Result” in the target base — 255 in decimal becomes 11111111 in binary.
  5. Read both lines. The result shows the converted value, and underneath it a “Decimal value” line shows the same number in base ten, so you can cross-check it.
  6. Copy it. Each line has its own copy button — copy the converted value, the decimal value, or both.

The result appears when you click Convert (or press Enter) — it does not update live as you type. To convert again, change the value or the bases and click Convert once more.

Base converter showing 42 in decimal converted to binary 101010, octal 52 and hex 2A

What Number Bases Are and Why They Exist

A number base, or radix, is how many distinct digits a counting system uses. Decimal is base ten, with digits 0 to 9. Binary is base two, with only 0 and 1. Octal is base eight, with digits 0 to 7. Hexadecimal is base sixteen, with digits 0 to 9 plus the letters A to F. The quantity never changes — only the notation does.

BaseDigitsOne digit coversWhere you meet it
Binary (2)0, 11 bitInside every computer
Octal (8)0–73 bitsFile permissions, some hardware
Decimal (10)0–9One of ten valuesEveryday counting
Hex (16)0–9, A–F4 bitsColour codes, addresses, debugging

Worked example — 255 in all four bases: in binary it is 11111111 (128 + 64 + 32 + 16 + 8 + 4 + 2 + 1); in octal it is 377 (3 × 64 + 7 × 8 + 7); in decimal it is 255; in hex it is FF (15 × 16 + 15). Four ways of writing the same quantity. Two more, for practice: 42 in decimal is 101010 in binary, 52 in octal and 2A in hex; 777 in octal is 511 in decimal.

Hex exists because it is shorthand for binary: one hex digit is exactly four binary digits, so a long string of 0s and 1s becomes a short, readable hex value. Octal does the same job with three bits per digit. That is why colours, memory addresses and low-level values are written in hex — #ff5733 is far easier to read than twenty-four binary digits.

This Converter Versus Manual Base Conversion

AspectBy handThis converter
255 decimal to binaryRepeatedly divide by 2, track remaindersType 255, pick Decimal → Binary, click Convert: 11111111
ff hex to decimal15 × 16 + 15 = 255Type ff, pick Hex → Decimal, click Convert: 255
Checking your answerConvert it back by handThe “Decimal value” line shows the answer in base ten automatically
Hex letter caseUsually written either wayOutput is always UPPERCASE (FF)
MistakesEasy to drop a digitInvalid digits are rejected with a message
SpeedA minute or two per numberSeconds, for any of the four bases

One difference to know: this converter writes hex in UPPERCASE (“FF”), while the separate Decimal to Hex tool writes it in lowercase (“ff”). The value is identical — only the letter case differs. If your code needs lowercase, change the letters yourself after copying.

Who Uses a Base Converter

Programmers. Converting between binary, hex and decimal while working with flags, bit masks, colours and addresses.

Students. Checking divide-by-2 and divide-by-16 working, and learning how the same quantity looks in each base.

Web developers. Turning decimal colour values into hex codes, and hex codes back into decimals.

People reading low-level values. Making sense of a hex address or an octal permission by seeing it in familiar decimal.

Anyone checking binary homework. A quick way to confirm a hand conversion before handing it in.

Pro Tips for Working Across Number Bases

Check the digits fit the From base first. Binary allows only 0 and 1 — a “2” in a binary number is rejected. Octal allows 0 to 7, decimal 0 to 9, hex 0 to 9 and A to F.

Use the Decimal value line as a cross-check. Every result shows its decimal value underneath — if that number is not what you expected, you picked the wrong source base.

Remember hex comes out UPPERCASE here. This tool gives FF, not ff. Change the case yourself if your code style wants lowercase.

Leading zeros are fine. “000255” in decimal converts to FF just like “255” does.

Convert one number at a time. The tool takes a single value — convert each number separately.

Double-check very large results. Numbers above 9,007,199,254,740,991 (2^53) can lose precision in the browser’s number handling, so verify huge values with a second method.

Copy before you leave. The result is not stored anywhere — use the copy buttons before you close the page.

Common Base Conversion Mistakes to Avoid

Entering 2 as a binary number. Binary has only 0 and 1 — the tool rejects “2” with an “Invalid digits for the selected base” message. Check the digits against the base.

Entering a negative number. A leading minus is not a valid digit in any base, so “−5” is rejected. This tool converts positive whole numbers only.

Entering a fraction. A decimal point is rejected too — convert the whole-number part only.

Forgetting to change the From base. If you type “255” while the source base is still Binary, the tool rejects it — set the source base to Decimal first.

Expecting lowercase hex. This tool outputs FF, not ff. The value is the same; only the case differs.

Expecting live updates. Nothing happens until you click Convert (or press Enter) — typing alone does not convert.

Trusting the last digits of a huge number. Above 2^53 the browser rounds, so a very large result can be off in the final digits — verify it another way.

Related Tools You May Need Next

Binary to Decimal. Turn binary digits back into a decimal number.

Decimal to Binary. A decimal number as plain binary digits.

Decimal to Hex. A decimal number as lowercase hex.

Binary to Hex. Binary groups to lowercase hex.

Hex to Binary. Hex back to binary digits.

Text to Hex. Text characters as two-digit hex values.

Scientific Notation Converter. Very large and very small numbers in scientific form.

Number to Words. Write a number out in English words.

Frequently Asked Questions

How do I convert between number bases?

Enter your number, pick the source base (Binary, Octal, Decimal or Hex), pick the target base, and click “Convert”. The result appears under “Result”, with its decimal value shown underneath.

Is this base converter free?

Yes. It is completely free with no account and no signup, and it runs in your browser, so nothing you type is uploaded.

Which bases does it support?

Four: Binary (2), Octal (8), Decimal (10) and Hex (16). You can convert between any pair of them, in either direction.

What is 255 in binary, octal and hex?

Binary 11111111, octal 377, hex FF. All four forms are the same quantity.

Why is the hex output uppercase?

This tool writes hex letters in capitals (FF). The value is identical to lowercase ff — change the case yourself if your code needs lowercase.

Can I convert negative numbers?

No. A leading minus is rejected as an invalid digit. This tool converts positive whole numbers only.

Why does it say “Invalid digits for the selected base”?

Your number contains a digit that does not exist in the source base — for example, a “2” in a binary number, or a letter in a decimal number. Check the digits and the source base, then try again.

Does it convert as I type?

No. The result appears only when you click Convert (or press Enter). Type the number, set both bases, then click.

What is the largest number I can convert?

There is no stated limit, but numbers above 9,007,199,254,740,991 (2^53) can lose precision in the browser, so verify very large results with a second method.

Is my number uploaded anywhere?

No. The conversion runs entirely in your browser with JavaScript — your number never leaves your device.