Skip to content

$ convert | bases | numbers

Binary, Decimal & Hex Converter

Convert between binary, octal, decimal and hexadecimal.

Converted value appears here.

The value is read in the FROM base and rewritten in the TO base with big-integer math, so long numbers keep every digit. Letters a–f cover hex; the conversion runs in this tab.

Convert a number between bases

  1. [01]

    Type the number into the NUMBER field, using only digits that are valid for its base.

  2. [02]

    Pick the base it is written in from FROM BASE.

  3. [03]

    Pick the base you want from TO BASE.

  4. [04]

    Read the result on the right, then use [copy] or clear the field to start over.

// What each base is used for

  • >Base 2 — binary — Only 0 and 1. Bit masks, feature flags and anything that maps onto hardware are written this way.
  • >Base 8 — octal — Groups binary into threes; file permissions such as 755 are the usual place you meet it.
  • >Base 10 — decimal — The base people read by default, and the one to convert to before a value goes into a report or a form.
  • >Base 16 — hex — 0–9 plus a–f. One digit is exactly four bits, so 0xFF is one byte — colours and memory addresses use it.

// Negatives, long values and decimals

A leading minus sign survives the conversion, and the digits are handled with big-integer math, so a long value keeps all of them instead of rounding the way a JavaScript Number would.

Only whole numbers are converted: a decimal point is not a digit in any of the four bases, so it is rejected with the same error as a wrong digit.

// Questions about this tool

How do I convert decimal to binary?

Set FROM BASE to 10 / decimal and TO BASE to 2 / binary, type the decimal value, and read the binary digits on the right.

How do I convert hex to decimal?

Choose 16 / hex as FROM BASE and 10 / decimal as TO BASE. Digits a–f are accepted in either case.

Why did I get an error?

One character is not valid for the FROM base — a letter in a decimal value, a 2 inside a binary value, or a decimal point anywhere.

Can it handle negative and very long values?

Yes. A leading minus sign is kept through the conversion, and big-integer math means a long value keeps every digit.