Decimal to Binary Converter: Base 10 to Base 2, Hex and Octal

Type a whole number. The converter shows its binary form, the form grouped in fours, hexadecimal and octal, the number of bits needed and the two's complement form for negative numbers.

FreeNo sign-upRuns in your browserUpdated 2 Nov 2026
A whole number, positive or negative.
Your resultLive

Estimates only. Check important results before you rely on them.

More Technology & Digital Tools calculators

View all 10

You may also need

From related categories

How to use this calculator

  1. Type a whole number.
  2. Pick a word size for negative numbers and padding.
  3. Read the binary form at the top.
  4. See the hex, octal, bits needed and the two's complement.

The formula

Divide the number by 2 repeatedly and write the remainders in reverse order. For a negative number in N bits, the two's complement is 2^N + Number.

Worked example

181 ÷ 2 gives remainders that read 10110101, which is 1011 0101 in binary, B5 in hex and 265 in octal. The number −5 in 8 bits is 2^8 − 5 = 251, which is 1111 1011.

Understanding your result

The tool uses exact big-number arithmetic, so very large values convert correctly. If a negative number is too big for the chosen word size, the tool says so.

When to use it

  • Learn how binary works.
  • Set bits for flags, masks and registers.
  • Convert IDs and addresses for programming.

Assumptions and limits

Whole numbers only. Fractions and floating-point formats are not covered.

Frequently asked questions

How do I convert decimal to binary?

Divide by 2 repeatedly, note each remainder, and read the remainders from last to first.

What is 10 in binary?

1010.

How are negative numbers stored?

Usually in two's complement, where the negative of a number is found by inverting its bits and adding 1.

What is the binary of 255?

11111111, which is 8 ones.

How many bits do I need for a number?

The "Bits needed" row shows the minimum.