fast&private

Convert Decimal to Binary

Convert any decimal number into its binary representation.

Your data is never sent to any server.

The decimal to binary converter turns any base 10 number into its representation in ones and zeros. The result appears as you type, alongside the same value in octal and hexadecimal.

The repeated division method

This is the classic way to do it by hand: divide by 2 over and over, keeping the remainder, then read the remainders in reverse at the end.

DivisionQuotientRemainder
11 / 251
5 / 221
2 / 210
1 / 201

Reading the remainders bottom to top: 1011. The other method, faster in your head, is subtracting powers of 2 from largest to smallest: 11 − 8 = 3, 3 − 2 = 1, 1 − 1 = 0, which switches on the 8, 2 and 1 bits.

How many bits you need

Decimal rangeBitsTypical use
0 – 2558One byte, one color channel
0 – 65,53516Network ports, short integers
0 – 4,294,967,29532IPv4 addresses, standard integers

Need the other direction? Go to binary to decimal.

How to use Decimal to Binary

  1. 1

    Type the decimal number

    Enter the base 10 number. You can group thousands with commas or spaces, which are ignored, but do not type decimals.

  2. 2

    Read the binary sequence

    The result in ones and zeros appears highlighted instantly, with no button to press.

  3. 3

    Copy the result

    Press the copy button on the binary row to send the sequence to your clipboard.

  4. 4

    Check the other bases

    Below you get the same number in octal and hexadecimal, handy when working with registers or addresses.

Frequently asked questions

How do you convert decimal to binary by hand?

Divide the number by 2 repeatedly and write down the remainder each time. When you are done, read the remainders bottom to top. For 11: 11/2 leaves 1, 5/2 leaves 1, 2/2 leaves 0 and 1/2 leaves 1, giving 1011.

How many bits does a number take?

As many as the largest power of 2 it needs. Up to 255 fits in 8 bits, up to 65535 needs 16, and up to 4,294,967,295 takes 32 bits.

Does the result include leading zeros?

No, the minimal representation is shown. If you need a fixed width of 8 or 16 bits, add the zeros in front yourself: they do not change the value.

Can negative numbers be converted?

Yes, with the sign in front: -11 gives -1011. A computer, however, stores negatives in two's complement, which depends on the word width (8, 16, 32 bits); in 8 bits, -11 would be 11110101. The tool does not produce that form.

What about numbers with decimals?

They are not supported. Commas and dots are treated as thousands separators, so 3.5 would be read as 35. The fractional part is converted with a different method, repeated multiplication by 2, and in practice it is stored as floating point, which is another format.