Decimal to Binary Converter

Convert decimal numbers (including floating point) to binary instantly. Supports integer and fractional decimal numbers with high precision.

Decimal Number System: Uses ten digits: 0-9. Supports both integer and fractional numbers.

Integer Conversion: Repeated division by 2, collecting remainders in reverse order

Fractional Conversion: Repeated multiplication by 2, collecting integer parts

Note: For signed mode, fractional numbers are not supported. Use IEEE 754 for signed floating point.

Enter a decimal number containing digits 0-9. Use dot (.) for fractional numbers. Scientific notation (e.g., 1.23e-4) is not supported.
0
1
2
5
10
13
42
255
0.5
0.25
1.5
5.625
13.375
Specify bit length for binary representation
For fractional decimal numbers
Convert to signed or unsigned binary
For fractional results

IEEE 754 Floating Point Standard: Standard for floating point arithmetic used by most computers.

Single precision (32-bit): 1 sign bit, 8 exponent bits, 23 mantissa bits

Double precision (64-bit): 1 sign bit, 11 exponent bits, 52 mantissa bits

Note: This implementation provides educational representation of IEEE 754. For exact conversion, specialized libraries are recommended.
Enter a decimal number to convert to IEEE 754 format
1.0
3.14159
-5.0
0.1
0.5
0.25
2.71828 (e)
0.000123
Select the floating point format
IEEE 754 rounding mode
Converting...

Understanding Decimal to Binary Conversion

Converting decimal numbers to binary involves different methods for the integer and fractional parts. The integer part uses repeated division by 2, while the fractional part uses repeated multiplication by 2.

Key Concept: Binary is a base-2 numeral system, meaning it uses only two digits: 0 and 1. Each binary digit (bit) represents a power of 2.

Conversion Methods

1

Integer Part: Repeatedly divide the integer by 2 and record the remainders. The binary equivalent is the remainders read in reverse order.

2

Fractional Part: Repeatedly multiply the fraction by 2. The integer part of each result becomes a binary digit. Continue with the fractional part.

3

Example (13): 13 ÷ 2 = 6 remainder 1, 6 ÷ 2 = 3 remainder 0, 3 ÷ 2 = 1 remainder 1, 1 ÷ 2 = 0 remainder 1 → Binary: 1101 (read remainders backwards)

Important Note: Two's complement representation is only for integers. For signed fractional numbers, use IEEE 754 floating point representation.

Common Decimal to Binary Conversions

Decimal Binary Power of 2
0 0 -
1 1 20
2 10 21
4 100 22
8 1000 23
16 10000 24
32 100000 25
64 1000000 26
128 10000000 27
255 11111111 28-1
0.5 0.1 2-1
0.25 0.01 2-2
0.125 0.001 2-3
0.0625 0.0001 2-4
5.625 101.101 4 + 1 + 0.5 + 0.125