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.
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):
| # | Division | Quotient | Remainder (Bit) |
|---|---|---|---|
| 1 | 255 ÷ 2 | 127 | 1 |
| 2 | 127 ÷ 2 | 63 | 1 |
| 3 | 63 ÷ 2 | 31 | 1 |
| 4 | 31 ÷ 2 | 15 | 1 |
| 5 | 15 ÷ 2 | 7 | 1 |
| 6 | 7 ÷ 2 | 3 | 1 |
| 7 | 3 ÷ 2 | 1 | 1 |
| 8 | 1 ÷ 2 | 0 | 1 |
11111111Breakdown by Powers of 2
Demonstration of how the sum of the bits multiplied by their weights results in the original decimal number:
| Bit | Power (2^n) | Value (Weight) | Contribution |
|---|---|---|---|
| 1 | 27 | 128 | 1 × 128 = 128 |
| 1 | 26 | 64 | 1 × 64 = 64 |
| 1 | 25 | 32 | 1 × 32 = 32 |
| 1 | 24 | 16 | 1 × 16 = 16 |
| 1 | 23 | 8 | 1 × 8 = 8 |
| 1 | 22 | 4 | 1 × 4 = 4 |
| 1 | 21 | 2 | 1 × 2 = 2 |
| 1 | 20 | 1 | 1 × 1 = 1 |
How to Use the Decimal to Binary Converter
Enter the Decimal Number
Enter the non-negative integer you want to convert into the input field.
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.
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
The decimal number 255 equals 11111111 in binary (8 consecutive 1 bits). It's the largest value representable in an unsigned byte.
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.
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.
To represent negative integers in digital systems, Two's Complement notation is used.