Decimal to Binary Converter

Free online decimal to binary converter with step-by-step explanation. Instantly convert any decimal number to binary code with 4/8/16/32-bit formatting.

Quick Value Selection
Binary Result (Base 2):
1111 1111

About this tool

The decimal system (base 10) is the standard used in everyday mathematics, while the binary system (base 2) is the native language of electronic circuits and computers. This tool performs precise conversion between the two systems, letting you format the output in bit groups (such as 4, 8, 16, or 32 bits) and follow the entire mathematical conversion process in detail.

Step-by-Step Resolution (Successive Divisions)

See how the value entered above is converted by dividing by 2 and collecting the remainders from bottom to top (from the last remainder to the first):

#DivisionQuotientRemainder (Bit)
1255 ÷ 21271
2127 ÷ 2631
363 ÷ 2311
431 ÷ 2151
515 ÷ 271
67 ÷ 231
73 ÷ 211
81 ÷ 201
Reading the result (remainders in reverse order):11111111

Breakdown by Powers of 2

Demonstration of how the sum of the bits multiplied by their weights results in the original decimal number:

BitPower (2^n)Value (Weight)Contribution
1271281 × 128 = 128
126641 × 64 = 64
125321 × 32 = 32
124161 × 16 = 16
12381 × 8 = 8
12241 × 4 = 4
12121 × 2 = 2
12011 × 1 = 1

How to Use the Decimal to Binary Converter

1

Enter the Decimal Number

Enter the non-negative integer you want to convert into the input field.

2

Adjust the Format

Choose the bit padding (4, 8, 16, or 32), add the '0b' prefix if needed, and enable grouping every 4 bits to make it easier to read.

3

Copy or Explore the Step-by-Step

Click to copy the result, or scroll down to see the detailed mathematical resolution with the successive divisions and the breakdown into powers of 2.

Practical Applications of Binary Code

The binary system is the fundamental language of computing and digital electronics. See where it's used in everyday life:

  • Digital Electronics and HardwareProcessors and integrated circuits operate with two voltage states: high (1) and low (0).
  • Computer Networks and IPIPv4 subnet masks (e.g. 255.255.255.0) are calculated by converting decimal octets to binary.
  • Programming and Bitwise FlagsDevelopers use bitwise operations (AND, OR, XOR) for permissions and memory optimization.
  • Data StorageFiles, images, and audio are stored on disk as sequences of binary bytes.

Frequently Asked Questions About Decimal to Binary

How do you convert the decimal number 255 to binary?

The decimal number 255 equals 11111111 in binary (8 consecutive 1 bits). It's the largest value representable in an unsigned byte.

What does the '0b' prefix mean before a binary number?

The '0b' prefix (e.g. 0b1010) is a convention used in programming languages (such as JavaScript, Python, and C++) to explicitly indicate that the following numeric sequence is a base-2 number.

What's the difference between 8-bit and 16-bit binary?

The difference is the number of digits (bits). An 8-bit binary (byte) can represent numbers from 0 to 255, while a 16-bit one can represent from 0 to 65,535 by padding the most significant bits with leading zeros.

How do you convert negative numbers to binary?

To represent negative integers in digital systems, Two's Complement notation is used.

Recommended Reading:Wikipedia (Binary Code)

See also