Base 10 to Base 2

Decimal to Binary Converter

Convert decimal whole numbers into binary instantly. View the binary result, follow the repeated division-by-two steps, and optionally format your result as an unsigned fixed-width value.

Open converter

Convert decimal to binary

Enter a non-negative whole number. The calculation is performed by PHP on the server, so JavaScript is not required for conversion.

Digits 0–9 only. Commas, spaces and underscores are accepted as separators.

How decimal-to-binary conversion works

Binary is a base-2 number system that uses only 0 and 1. To convert a whole decimal number to binary, repeatedly divide the number by two and record each remainder.

Example: convert 13 to binary

  1. 13 divided by 2 gives quotient 6 and remainder 1.
  2. 6 divided by 2 gives quotient 3 and remainder 0.
  3. 3 divided by 2 gives quotient 1 and remainder 1.
  4. 1 divided by 2 gives quotient 0 and remainder 1.

Read the remainders in reverse order: 1101. Therefore, 13 in decimal equals 1101 in binary.

Decimal to binary conversion examples

Use this reference table to check common conversions.

Decimal Binary Explanation
0 0 Zero
1 1 Powers of two
2 10 Powers of two
5 101 Powers of two
10 1010 Powers of two
13 1101 Powers of two
25 11001 Powers of two
42 101010 Powers of two
100 1100100 Powers of two
255 11111111 2⁸ − 1
256 100000000 Powers of two
1024 10000000000 Powers of two

Understanding binary place values

Each position in a binary number represents a power of two, starting at 2⁰ on the right. The next positions represent 2¹, 2², 2³, and higher powers.

For example, binary 1011 represents:

1 × 8 + 0 × 4 + 1 × 2 + 1 × 1 = 11

Therefore, 1011 in base 2 equals 11 in base 10. You can use this method to verify a conversion manually.

Natural-length and fixed-width binary

Natural-length output

Shows only the bits needed to represent the number. For example, decimal 5 becomes 101.

Fixed-width output

Adds leading zeros to reach a selected width. Decimal 5 in unsigned 8-bit form is 00000101.

This tool converts non-negative integers and formats them as unsigned binary. Negative values and decimal fractions are not supported.

Related binary tools

Frequently asked questions

How do I convert decimal to binary?

Repeatedly divide the whole decimal number by two, record the remainders, and read those remainders in reverse order.

What is decimal 10 in binary?

Decimal 10 is binary 1010 because 10 equals 8 plus 2.

Can this converter process large numbers?

Yes. It processes decimal digits as strings instead of converting the whole input to a PHP integer. Inputs are limited to 4,000 digits to keep processing manageable.

Can I convert a decimal fraction?

No. This page converts non-negative whole numbers. Fractional values need a separate conversion method.

What happens if a number does not fit in 8 bits?

The calculator displays an error instead of truncating the number. For example, 256 requires nine bits and cannot be represented as an unsigned 8-bit value.

Explore more binary calculators

Convert numbers, work with bits, and learn the foundations of digital computing.

Browse all Binarios.org tools