Calculator

Decimal to Binary Converter: Convert Decimal Numbers to Binary

Free decimal to binary converter with step-by-step solutions. Learn how to convert decimal numbers to binary with formulas, examples, conversion tables, and instant calculator.
Decimal to Binary converter

Decimal to Binary Converter: Convert Decimal Numbers

A decimal to binary converter transforms decimal numbers (base-10 numbers using digits 0-9) into binary numbers (base-2 numbers using only digits 0 and 1) through repeated division by 2, tracking remainders in reverse order to obtain the binary representation essential for computer science, digital electronics, programming, data communication, and understanding how computers internally store and process numerical information. This conversion process uses the division-remainder method where the decimal number is repeatedly divided by 2, recording each remainder (0 or 1), then reading these remainders from bottom to top to form the binary equivalent, enabling translation from human-readable decimal format to machine-readable binary format for computer programming, digital logic design, binary arithmetic, data encoding, and foundational understanding of number systems in computing and electronics.

🔢 Decimal to Binary Converter

Enter a decimal number to convert to binary

Maximum value: 2,147,483,647

Understanding Decimal to Binary Conversion

Decimal is the base-10 number system we use daily, consisting of ten digits (0-9). Binary is the base-2 number system used by computers, consisting of only two digits (0 and 1). Converting decimal to binary reveals how computers represent numbers internally, as digital circuits can only recognize two states: on (1) or off (0).

Decimal to Binary Formula

Division-Remainder Method:

Repeatedly divide the decimal number by 2

Record the remainder at each step (0 or 1)

Read remainders from bottom to top

Mathematical Expression:

\[ \text{Binary} = \sum_{i=0}^{n-1} r_i \times 2^i \]

Where \( r_i \) is the remainder at each division step

Step-by-Step Conversion Method

Division-Remainder Algorithm

  1. Divide the decimal number by 2
  2. Record the remainder (0 or 1)
  3. Divide the quotient by 2 again
  4. Repeat until quotient becomes 0
  5. Read remainders from bottom to top for binary result

Detailed Conversion Examples

Example 1: Convert Decimal 13 to Binary

Problem: Convert decimal 13 to binary

Step-by-step division:

Division    Quotient    Remainder
13 ÷ 2  =   6           1  ← LSB (rightmost)
6  ÷ 2  =   3           0
3  ÷ 2  =   1           1
1  ÷ 2  =   0           1  ← MSB (leftmost)
        

Read remainders bottom to top: 1101

Answer: 13₁₀ = 1101₂

Verification: (1×8) + (1×4) + (0×2) + (1×1) = 8 + 4 + 0 + 1 = 13 ✓

Example 2: Convert Decimal 42 to Binary

Problem: Convert decimal 42 to binary

Division process:

42 ÷ 2 = 21  remainder 0
21 ÷ 2 = 10  remainder 1
10 ÷ 2 = 5   remainder 0
5  ÷ 2 = 2   remainder 1
2  ÷ 2 = 1   remainder 0
1  ÷ 2 = 0   remainder 1
        

Reading bottom to top: 101010

Answer: 42₁₀ = 101010₂

Verification:

32 + 0 + 8 + 0 + 2 + 0 = 42 ✓

Example 3: Convert Decimal 255 to Binary

Problem: Convert decimal 255 to binary

Quick observation: 255 is the maximum value for 8 bits

Division steps:

255 ÷ 2 = 127 R 1

127 ÷ 2 = 63 R 1

63 ÷ 2 = 31 R 1

31 ÷ 2 = 15 R 1

15 ÷ 2 = 7 R 1

7 ÷ 2 = 3 R 1

3 ÷ 2 = 1 R 1

1 ÷ 2 = 0 R 1

Result: 11111111 (eight 1s)

Answer: 255₁₀ = 11111111₂

💡 Pattern: All 1s = maximum value for n bits = 2ⁿ - 1

Decimal to Binary Conversion Table

DecimalBinaryCalculation
000
112⁰ = 1
2102¹ = 2
3odede>112¹ + 2⁰ = 2 + 1
41002² = 4
5odede>1012² + 2⁰ = 4 + 1
1010108 + 2
1511118 + 4 + 2 + 1
16100002⁴ = 16
321000002⁵ = 32
64odede>10000002⁶ = 64
100110010064 + 32 + 4
128100000002⁷ = 128
25511111111All bits set (8-bit max)

Powers of 2 Reference (Binary Place Values)

PositionPowerDecimal ValueBinary
02⁰11
1210
24100
381000
42⁴1610000
52⁵32100000
62⁶64odede>1000000
72⁷12810000000
82⁸256100000000
102¹⁰1,0241KB (approx)

Alternative Conversion Methods

Method 2: Subtraction Method

Concept: Subtract largest power of 2, mark positions

Example: Convert 45 to binary

Step 1: Find largest power of 2 ≤ 45

32 (2⁵) fits, so position 5 = 1

45 - 32 = 13 remaining

Step 2: Next largest ≤ 13

8 (2³) fits, so position 3 = 1

13 - 8 = 5 remaining

Step 3: Next largest ≤ 5

4 (2²) fits, so position 2 = 1

5 - 4 = 1 remaining

Step 4: Last bit

1 (2⁰) fits, so position 0 = 1

Result: Positions 5,3,2,0 are set = 101101

Real-World Applications

Computer Science

  • Data representation: How computers store integers
  • IP addressing: IPv4 addresses are 32-bit binary numbers
  • File permissions: Unix/Linux file modes (rwx = 111)
  • Bit flags: Settings and options in programming
  • Network masks: Subnet masks in binary

Digital Electronics

  • Logic circuits: Digital circuit design and analysis
  • Microcontrollers: Programming embedded systems
  • Data encoding: Error detection and correction
  • Display systems: Seven-segment displays, LEDs
  • Communication: Serial and parallel data transmission

Common Conversion Patterns

Quick Recognition Tips:

  • Powers of 2: 1, 2, 4, 8, 16, 32, 64, 128, 256 have single 1 bit
  • One less than power of 2: All 1s (7=111, 15=1111, 31=11111)
  • Even numbers: Always end in 0 (LSB = 0)
  • Odd numbers: Always end in 1 (LSB = 1)
  • Multiples of 4: Last two bits are 00
  • Max n-bit value: All 1s = 2ⁿ - 1

Tips for Manual Conversion

Conversion Strategies:

  1. Memorize powers of 2: Up to at least 2¹⁰ = 1024
  2. Use graph paper: Organize division steps neatly
  3. Double-check: Convert back to decimal to verify
  4. Work systematically: Don't skip steps
  5. Practice regularly: Build speed and accuracy
  6. Learn patterns: Recognize common decimal-binary pairs

Common Mistakes to Avoid

⚠️ Conversion Errors

  • Reading remainders wrong direction: Must read bottom to top, not top to bottom
  • Forgetting remainders: Record every remainder (even 0s)
  • Stopping too early: Continue until quotient is 0
  • Arithmetic mistakes: Verify each division step
  • Mixing up MSB/LSB: Most significant bit is leftmost
  • Ignoring zeros: Leading zeros can be dropped, but not trailing
  • Negative numbers: Basic method only works for positive integers

Binary Representation Ranges

BitsRange (Unsigned)Maximum ValueBinary Max
4 bits0 to 1515odede>1111
8 bits (byte)0 to 25525511111111
16 bits0 to 65,53565,53516 ones
32 bits0 to 4,294,967,295~4.3 billion32 ones
64 bits0 to 18,446,744,073,709,551,615~18 quintillion64 ones

Frequently Asked Questions

How do you convert decimal to binary by hand?

Use the division-remainder method: repeatedly divide the decimal number by 2, recording each remainder (0 or 1). Continue dividing the quotient by 2 until it reaches 0. Read all remainders from bottom to top to get the binary result. Example: 13÷2=6 R1, 6÷2=3 R0, 3÷2=1 R1, 1÷2=0 R1. Reading bottom-up gives 1101. Always record remainders in order and read backwards. Practice makes this process quick and intuitive.

Why do we read remainders from bottom to top?

The first remainder represents the least significant bit (rightmost, 2⁰ position), while the last remainder represents the most significant bit (leftmost, highest power of 2). Reading bottom-to-top arranges bits in correct order: MSB to LSB (left to right). This aligns with how we write numbers with most significant digits first. The division order naturally produces bits in reverse, so bottom-up reading corrects this. Standard convention in computer science and mathematics.

What is the binary equivalent of decimal 100?

Decimal 100 equals binary 1100100. Calculation: 100÷2=50 R0, 50÷2=25 R0, 25÷2=12 R1, 12÷2=6 R0, 6÷2=3 R0, 3÷2=1 R1, 1÷2=0 R1. Reading bottom-up: 1100100. Verification: 64+32+4 = 100. This is 7 bits long. Useful to memorize common values like 100 for quick conversions. In hex, 100₁₀ = 64₁₆. Used frequently in programming (percentage values, RGB colors).

How many bits are needed to represent a decimal number?

Use formula: bits needed = ⌈log₂(n+1)⌉ (ceiling of log base 2). Practical: find smallest power of 2 greater than number. Examples: 7 needs 3 bits (2³=8), 15 needs 4 bits (2⁴=16), 255 needs 8 bits (2⁸=256). General rule: n bits can represent 0 to 2ⁿ-1. To represent number N, need at least ⌈log₂(N)⌉ bits. Important for data type selection in programming, memory allocation.

Can decimal fractions be converted to binary?

Yes! Fractional part uses different method: multiply by 2, take integer part as bit, repeat with fractional part. Example: 0.75₁₀. 0.75×2=1.5 (bit=1), 0.5×2=1.0 (bit=1). Result: 0.11₂. Not all decimal fractions have exact binary equivalents (e.g., 0.1₁₀ = 0.0001100110011...₂ repeating). Causes floating-point precision issues in computers. Important for understanding rounding errors in programming, why 0.1+0.2≠0.3 in many languages.

What's the fastest way to convert small decimal numbers?

Memorize common conversions (0-16). Use subtraction method: subtract largest power of 2 that fits, mark that bit position, repeat. Example: 13. Subtract 8 (2³), leaves 5. Subtract 4 (2²), leaves 1. Subtract 1 (2⁰). Positions 3,2,0 set = 1101. Faster than division for small numbers once you know powers of 2. Also recognize patterns: even=ends in 0, odd=ends in 1. With practice, common values become instant recall.

Key Takeaways

Converting decimal to binary is a fundamental skill in computer science and digital electronics. The division-remainder method provides a systematic approach to transform human-readable decimal numbers into machine-readable binary format, essential for understanding how computers store and process data at the most basic level.

Essential principles to remember:

  • Binary uses base-2: only digits 0 and 1
  • Division-remainder method: divide by 2, record remainders
  • Read remainders bottom to top for correct binary
  • Each bit position represents a power of 2
  • Even numbers end in 0, odd numbers end in 1
  • n bits can represent values 0 to 2ⁿ-1
  • 8 bits = 1 byte, max value 255
  • Always verify by converting back to decimal
  • Memorize powers of 2 for faster conversions
  • Practice regularly to build speed and accuracy

Getting Started: Use the interactive converter at the top of this page to convert any decimal number to binary instantly. Enter your decimal number, click convert, and receive the binary result with complete step-by-step breakdown showing the division process, remainders at each step, and verification calculation. Perfect for learning, homework, programming, or professional work requiring decimal-to-binary conversions.

Shares: