Decimal to Binary Converter
Convert decimal numbers to binary. See step-by-step conversion process.
Decimal: 42
101010
Binary
All Conversions
101010
Binary
52
Octal
0x2A
Hexadecimal
Conversion Steps
Divide by 2 repeatedly, collect remainders from bottom to top:
| Step | Number ÷ 2 | Quotient | Remainder |
|---|---|---|---|
| 1 | 42 ÷ 2 | 21 | 0 |
| 2 | 21 ÷ 2 | 10 | 1 |
| 3 | 10 ÷ 2 | 5 | 0 |
| 4 | 5 ÷ 2 | 2 | 1 |
| 5 | 2 ÷ 2 | 1 | 0 |
| 6 | 1 ÷ 2 | 0 | 1 |
Reading remainders from bottom to top: 101010
Common Conversions
10
= 1010
100
= 1100100
255
= 11111111
1000
= 1111101000
What is a Decimal to Binary Converter?
A decimal to binary converter translates numbers from the decimal (base-10) numeral system, which humans use daily, to the binary (base-2) system, which computers use to represent and process all data. Every piece of digital information — text, images, video, software instructions — is ultimately stored and manipulated as sequences of binary digits (bits), each being either 0 or 1. Understanding this conversion is fundamental to computer science, digital electronics, and information theory.
The decimal system uses ten digits (0 through 9) and is positional, meaning each digit's value depends on its position relative to the decimal point. The binary system uses only two digits (0 and 1) but follows the same positional principle. Each binary position represents a power of 2, starting from 2⁰ = 1 on the right and increasing leftward: 2, 4, 8, 16, 32, 64, and so on. The decimal number 42, for example, is expressed in binary as 101010, which represents 32 + 8 + 2 = 42.
This converter not only performs the translation but also displays the step-by-step conversion process, showing each division by 2 and the resulting remainder that forms each binary digit. It also shows the equivalent octal (base-8) and hexadecimal (base-16) representations, which are commonly used as compact representations of binary data in programming and systems engineering.
The Decimal to Binary Conversion Method
The standard method for converting decimal to binary is repeated division by 2, collecting the remainders. The remainders, read from the last division to the first, form the binary number.
Decimal to Binary (Repeated Division by 2)
Where:
- Quotient= The result of dividing the current number by 2
- Remainder= 0 or 1 — this becomes the next binary digit (bit)
- Original= The number being divided at each step
Understanding Binary Positional Values
Just as decimal digits represent powers of 10, binary digits represent powers of 2. Understanding this relationship is key to understanding binary numbers.
- Position 0 (rightmost): 2⁰ = 1. The least significant bit (LSB).
- Position 1: 2¹ = 2
- Position 2: 2² = 4
- Position 3: 2³ = 8
- Position 4: 2⁴ = 16
- Position 5: 2⁵ = 32
- Position 6: 2⁶ = 64
- Position 7: 2⁷ = 128. The most significant bit (MSB) for an 8-bit byte.
Each bit in a binary number contributes either 0 or its positional power of 2 to the total value. The binary number 101010 equals 32 + 0 + 8 + 0 + 2 + 0 = 42 in decimal.
How to Use This Calculator
The converter provides comprehensive number system conversion with step-by-step explanation:
- Enter a decimal number: Type any non-negative integer into the "Decimal Number" input field.
- Read the binary result: The binary representation appears prominently in the main result display, shown in monospace font for clarity.
- View all representations: Below the main result, a grid shows the number in binary, octal, and hexadecimal formats simultaneously.
- Study the conversion steps: For positive non-zero inputs, a detailed table shows each division step, displaying the original number, the quotient after dividing by 2, and the remainder (0 or 1) at each stage.
- Read the result interpretation: Below the steps table, the final binary number is displayed with an explanation that reading the remainders from bottom to top gives the binary result.
- Check common conversions: A reference table shows binary equivalents for 10, 100, 255, and 1000 for quick comparison.
Real-World Applications
Computer architecture and digital electronics operate entirely in binary. Every instruction executed by a processor, every pixel displayed on a screen, and every character transmitted over a network is represented as binary data. Understanding decimal-to-binary conversion helps programmers comprehend how numbers are stored in memory, how bitwise operations work, and why certain decimal values produce specific patterns in binary representation. For example, powers of 2 (1, 2, 4, 8, 16, 32...) have binary representations with exactly one bit set to 1, which is fundamental to understanding bitmasks and flags in programming.
Network engineering requires binary conversion for IP addressing and subnet calculations. An IPv4 address like 192.168.1.100 is actually four 8-bit binary numbers (octets). Converting each decimal octet to binary reveals the actual network and host portions of the address when combined with a subnet mask. Understanding binary helps network engineers quickly identify address ranges, calculate subnet boundaries, and troubleshoot routing issues.
Data encoding and compression algorithms manipulate binary representations directly. File formats like JPEG, PNG, and MP3 store data in specific binary structures. Character encodings like ASCII and Unicode map characters to binary codes. Understanding how decimal values translate to binary helps developers work with binary file formats, implement data compression, and debug encoding issues in software applications.
Worked Examples
Converting 42 to Binary
Problem:
Convert the decimal number 42 to binary using repeated division.
Solution Steps:
- 142 ÷ 2 = 21 remainder 0
- 221 ÷ 2 = 10 remainder 1
- 310 ÷ 2 = 5 remainder 0
- 45 ÷ 2 = 2 remainder 1
- 52 ÷ 2 = 1 remainder 0
- 61 ÷ 2 = 0 remainder 1
- 7Read remainders from bottom to top: 101010
Result:
42 in decimal equals 101010 in binary
Converting 255 to Binary
Problem:
Convert 255 to binary and explain why it has all bits set.
Solution Steps:
- 1255 ÷ 2 = 127 remainder 1
- 2127 ÷ 2 = 63 remainder 1
- 363 ÷ 2 = 31 remainder 1
- 431 ÷ 2 = 15 remainder 1
- 515 ÷ 2 = 7 remainder 1
- 67 ÷ 2 = 3 remainder 1
- 73 ÷ 2 = 1 remainder 1
- 81 ÷ 2 = 0 remainder 1
- 9Result: 11111111 (eight 1s)
Result:
255 in decimal equals 11111111 in binary — all 8 bits set to 1
Power of Two Verification
Problem:
Convert 64 to binary and explain why powers of two have a special binary pattern.
Solution Steps:
- 164 ÷ 2 = 32 remainder 0
- 232 ÷ 2 = 16 remainder 0
- 316 ÷ 2 = 8 remainder 0
- 48 ÷ 2 = 4 remainder 0
- 54 ÷ 2 = 2 remainder 0
- 62 ÷ 2 = 1 remainder 0
- 71 ÷ 2 = 0 remainder 1
- 8Result: 1000000 (a single 1 followed by six 0s)
Result:
64 equals 2⁶, which in binary is 1 followed by 6 zeros
Tips & Best Practices
- ✓Powers of 2 in binary are always a single 1 followed by zeros: 2=10, 4=100, 8=1000.
- ✓The decimal number 255 equals 11111111 in binary — all 8 bits set to 1.
- ✓Each hexadecimal digit maps to exactly 4 binary digits, making hex a compact binary shorthand.
- ✓To verify a binary conversion, expand each bit position as a power of 2 and sum them.
- ✓Use the conversion steps table to understand the algorithm, not just the result.
- ✓Common binary patterns: 1010 = 10 decimal, 1100 = 12 decimal, 1111 = 15 decimal.
Frequently Asked Questions
Sources & References
Last updated: 2026-06-06
Help us improve!
How would you rate the Decimal to Binary Converter?
Editorial Note
MyCalcBuddy Editorial Team
This page is maintained as an educational calculator reference.
Formula Source: NIST Guide to SI Units
by National Institute of Standards