> >Decimal to Binary Converter
Decimal to Binary Converter
Convert decimal numbers (base-10) to binary (base-2), hexadecimal (base-16), and octal (base-8). Includes step-by-step calculation.
Decimal Number
Conversion Result
Binary: 1101
Hexadecimal: D
Octal: 15
Step-by-step calculation (division by 2):
13 ÷ 2 = 6 remainder 1
6 ÷ 2 = 3 remainder 0
3 ÷ 2 = 1 remainder 1
1 ÷ 2 = 0 remainder 1
Read remainders bottom to top: 1101
Related Tools
External Resources
Frequently Asked Questions
- How do I convert decimal to binary?
- To convert decimal to binary, repeatedly divide the number by 2 and record the remainder. Read the remainders from bottom to top (last to first). For example, 13: 13÷2=6 r1, 6÷2=3 r0, 3÷2=1 r1, 1÷2=0 r1 → 1101₂.
- What is the binary representation of 255?
- 255 in binary is 11111111. This is calculated by repeatedly dividing 255 by 2: remainders read bottom-up give all 1s: 128+64+32+16+8+4+2+1 = 255.
- How do I convert decimal to binary in Python?
- Use bin(decimal_number) to get the binary string. For example, bin(10) returns "0b1010". Use format(decimal_number, "b") to get "1010" without the prefix. For the reverse: int("1010", 2) converts binary back to decimal.
- What is the decimal to binary conversion table?
- 0=0, 1=1, 2=10, 3=11, 4=100, 5=101, 6=110, 7=111, 8=1000, 9=1001, 10=1010, 11=1011, 12=1100, 13=1101, 14=1110, 15=1111, 16=10000, 32=100000, 64=1000000, 128=10000000, 255=11111111.
- How do I convert decimal to binary for numbers with fractions?
- For the integer part, use the division method. For the fractional part, multiply by 2 repeatedly: take the integer part as the next binary digit, continue with the fractional part. Example: 0.625 × 2 = 1.25 (digit 1), 0.25 × 2 = 0.5 (digit 0), 0.5 × 2 = 1.0 (digit 1) → 0.101₂.
- What is the decimal number system?
- The decimal system (base-10) is the standard number system used by humans. It uses ten digits (0-9) and each place value is a power of 10. It originated from counting on fingers and is the most widely used number system in everyday life.
- How do I convert decimal to hex?
- Divide the decimal number repeatedly by 16, recording remainders. Remainders 10-15 are represented as A-F. Read remainders bottom-up. For example, 255: 255÷16=15 r15(F), 15÷16=0 r15(F) → FF₁₆. This converter shows both binary and hex results.
- What is the binary equivalent of 100?
- 100 in decimal = 1100100 in binary. Calculation: 100÷2=50r0, 50÷2=25r0, 25÷2=12r1, 12÷2=6r0, 6÷2=3r0, 3÷2=1r1, 1÷2=0r1. Reading remainders bottom-up: 1100100₂ = 64+32+4 = 100.
- How do I check my decimal to binary conversion?
- To verify: convert the binary result back to decimal by multiplying each bit by its power of 2 and summing. For example, 1100100₂ = 1×64 + 1×32 + 0×16 + 0×8 + 1×4 + 0×2 + 0×1 = 64+32+4 = 100. This converter provides step-by-step verification.
- What is the largest decimal number representable in 8 bits?
- In 8 bits (unsigned), the maximum is 255 (11111111₂). For signed 8-bit (two's complement), the range is -128 to 127. For 16 bits: 0-65,535 unsigned. For 32 bits: 0-4,294,967,295 unsigned.
- How do I convert decimal to binary using a calculator?
- Repeatedly divide by 2 and track remainders. Read remainders from last to first. Alternatively, subtract powers of 2 (1, 2, 4, 8, 16, 32...) from the number and place 1s in corresponding positions. This converter shows the complete step-by-step process.
- What is the decimal to binary conversion for 42?
- 42 in decimal = 101010 in binary. Calculation: 42÷2=21r0, 21÷2=10r1, 10÷2=5r0, 5÷2=2r1, 2÷2=1r0, 1÷2=0r1. Reading remainders: 101010₂ = 32+8+2 = 42. This is the famous "Answer to the Ultimate Question of Life, the Universe, and Everything."
- How do I convert negative decimal to binary?
- Negative numbers are typically represented using two's complement. To convert -5 to binary: convert +5 to binary (00000101), invert all bits (11111010), add 1 (11111011). The most significant bit indicates the sign (1 = negative).
- What is the relationship between binary and computing?
- Binary is fundamental to computing because electronic circuits have two stable states (on/off, high/low voltage). All computer data, instructions, and operations are ultimately binary. Understanding binary to decimal conversion is essential for programming, networking, and computer architecture.
- How do I convert a decimal IP address to binary?
- Convert each octet (0-255) separately to 8-bit binary. For example, 192.168.1.1: 192=11000000, 168=10101000, 1=00000001, 1=00000001 → 11000000.10101000.00000001.00000001. This is useful for subnetting and network configuration.
- What is the binary representation of 0?
- 0 in binary is simply 0 (or any number of leading zeros). Unlike other bases, the representation of zero in binary is unambiguous. In computing, zero is often represented as a full word of zeros (e.g., 00000000 for a byte).
- How do I convert decimal to binary in JavaScript?
- Use Number.toString(2): (255).toString(2) returns "11111111". For a broader numeric conversion: decNumber.toString(2). For parsing binary back: parseInt("11111111", 2) returns 255.
- What is the decimal number 128 in binary?
- 128 in binary is 10000000. This is 2⁷ = 128. In binary, all powers of 2 are a single 1 followed by zeros. 128 is significant in computing as the most significant bit value in an 8-bit byte.
- How do I convert decimal to octal?
- Divide the decimal number repeatedly by 8 and record remainders. Read remainders bottom-up. For example, 100: 100÷8=12r4, 12÷8=1r4, 1÷8=0r1 → 144₈ = 1×64 + 4×8 + 4 = 100. This converter shows binary, hex, and octal results.
- What are powers of 2 in binary?
- Powers of 2 in binary always have a single 1 followed by zeros: 2⁰=1 (1), 2¹=2 (10), 2²=4 (100), 2³=8 (1000), 2⁴=16 (10000), 2⁵=32 (100000), 2⁶=64 (1000000), 2⁷=128 (10000000), 2⁸=256 (100000000), 2⁹=512 (1000000000), 2¹⁰=1024 (10000000000).
- How do I convert a large decimal to binary?
- For large numbers, use the division method or subtract powers of 2. Keep dividing by 2 and collecting remainders until reaching 0. Online tools and programming languages handle arbitrarily large numbers. This converter handles any positive integer.
- What is the decimal number 31 in binary?
- 31 in binary is 11111 (five 1s). This is because 31 = 16+8+4+2+1 = 2⁴+2³+2²+2¹+2⁰. 31 is also represented as 0x1F in hex and 37 in octal. It is the maximum value for a 5-bit unsigned number.
- How do I verify my decimal to binary conversion?
- Multiply each binary digit by its power of 2 and sum the results. The total should equal the original decimal number. This converter automatically provides this verification as part of the step-by-step output.
- What is the binary number for powers of 10?
- 10 = 1010₂, 100 = 1100100₂, 1000 = 1111101000₂, 10000 = 10011100010000₂. Unlike powers of 2, powers of 10 in binary have no simple pattern. This is why some decimal numbers cannot be represented exactly in binary floating-point.
- How do I convert decimal to binary for memory addresses?
- Memory addresses are typically expressed in hex for readability, but internally they are binary. Converting decimal addresses to binary helps understand memory layout, page sizes, and alignment. Modern systems use 32-bit or 64-bit addressing.
- What is the decimal number 15 in binary?
- 15 in binary is 1111 (four 1s). 15 = 8+4+2+1 = 2³+2²+2¹+2⁰. In hex, 15 is F. In octal, it is 17. 15 is the maximum value for a 4-bit unsigned number (a nibble) and is commonly used in bitmask operations.
- How do I convert decimal to binary for flags and bitmasks?
- Each bit in a binary number can represent a boolean flag (0=off, 1=on). A bitmask uses specific bit positions to enable/disable features. For example, decimal 5 = 0101 binary might mean flags A=true, B=false, C=true, D=false.
- What is the decimal number 1024 in binary?
- 1024 in binary is 10000000000 (1 followed by 10 zeros). This is 2¹⁰ = 1024. This number is significant in computing: 1 kilobyte = 1024 bytes, 1 kilobit = 1024 bits (in binary prefixes).
- How do I convert decimal to binary for subnet masks?
- Subnet masks are continuous strings of 1s followed by 0s in binary. 255.255.255.0 = 11111111.11111111.11111111.00000000 (24 ones, /24). Converting decimal subnet masks to binary helps visualize the network and host portions of IP addresses.
- What is the binary representation of numbers 1-20?
- 1=1, 2=10, 3=11, 4=100, 5=101, 6=110, 7=111, 8=1000, 9=1001, 10=1010, 11=1011, 12=1100, 13=1101, 14=1110, 15=1111, 16=10000, 17=10001, 18=10010, 19=10011, 20=10100. Notice how the pattern grows as numbers increase.
- How do I convert decimal to binary for file permissions?
- Unix file permissions use 3-bit groups for owner/group/others: r=4 (100₂), w=2 (010₂), x=1 (001₂). Permission 755 binary = 111 101 101 = rwx r-x r-x. Each octal digit represents 3 binary bits of permissions.
- What is the difference between base-2 and base-10 representation?
- Base-2 (binary) uses only digits 0-1 and place values as powers of 2. Base-10 (decimal) uses digits 0-9 and place values as powers of 10. Any integer can be represented in either system, but binary requires more digits to represent the same value.