Decimal to Binary Converter
Convert decimal integers, fractional numbers, and signed Two's Complement values into exact base-2 binary with step-by-step divide-by-2 and multiply-by-2 math.
Decimal to Binary Chart (Integers & Fractions)
Base 10 → Base 2| Decimal | Binary (Base 2) | Hex / Float32 | Reference Note |
|---|---|---|---|
| 10 | 1010 | 0xA | 4-bit integer (8 + 2) |
| 42 | 101010 | 0x2A | 6-bit alternating pattern |
| 128 | 10000000 | 0x80 | 2^7 byte MSB weight |
| 255 | 11111111 | 0xFF | Max unsigned 8-bit byte |
| 1,024 | 10000000000 | 0x400 | 2^10 (1 KiB boundary) |
| 0.5 | 0.1 | 0x3F000000 | Exact fraction (2^-1) |
| 0.25 | 0.01 | 0x3E800000 | Exact fraction (2^-2) |
| 0.625 | 0.101 | 0x3F200000 | Exact sum (0.5 + 0.125) |
| 13.625 | 1101.101 | 0x415A0000 | Mixed integer + fraction |
| 0.1 | 0.000110011001… | 0x3DCCCCCD | Repeating binary fraction |
Click any integer or fraction row to load it into the decimal to binary converter and inspect its complete divide-by-2 or multiply-by-2 derivation.
Signal & Number Converters
9 toolsDivide-by-2 Integers & Fractional Multiplication Algorithm
Converting base-10 numbers to radix-2 relies on two complementary algorithms. For whole numbers, divide the decimal integer by 2 repeatedly and collect each remainder (0 or 1) from bottom to top. For decimal fractions such as 0.625, apply repeated multiplication by 2 to the fractional part and record each integer carry bit from top to bottom. This decimal to binary converter prints both derivation tables live with zero floating-point rounding drift.
When inspecting hardware registers or negative values, switch the width selector in this decimal to binary converter to signed int8, int16, int32, or int64 Two’s Complement. Fractional inputs also render their exact IEEE 754 single-precision float32 sign, exponent, and mantissa fields alongside nibble-grouped binary output.
Only dyadic fractions whose reduced denominator is a power of two—such as 1/2 (0.5), 1/4 (0.25), and 5/8 (0.625)—terminate cleanly in base 2. Any denominator containing another prime factor like 5 (such as 0.1 or 0.3) becomes an infinite periodic binary fraction, which hardware rounds to 23 mantissa bits under IEEE 754 single-precision encoding.
Integer & Fractional Binary Worked Examples
Review the interactive decimal to binary chart above or study these benchmark conversions covering unsigned integers, terminating binary fractions, and signed byte registers:
| Decimal (Base 10) | Divide / Multiply by 2 Trace | Binary (Base 2) | Notes |
|---|---|---|---|
| 13 | 13÷2=6 r1; 6÷2=3 r0; 3÷2=1 r1; 1÷2=0 r1 | 1101 | 4-bit integer read bottom-to-top |
| 42 | Remainders 0, 1, 0, 1, 0, 1 read upward | 101010 | 6-bit integer (32 + 8 + 2) |
| 255 | Eight consecutive odd divisions → eight 1 bits | 11111111 | Full single unsigned byte (0xFF) |
| 0.625 | 0.625×2=1.25 (1); 0.25×2=0.5 (0); 0.5×2=1.0 (1) | 0.101 | Terminating fraction (1/2 + 1/8) |
| 13.625 | Integer 1101 + fractional .101 combined | 1101.101 | Exact mixed radix-2 number |
| −128 (int8) | 2⁸ − 128 = 128 → 10000000 signed byte | 10000000 | Two’s Complement int8 minimum |
Working across multiple number bases? Jump to our Binary to Decimal Converter, Decimal to Hex Converter, or translate UTF-8 text streams in our 8-bit Binary Workbench.
“Binary floating-point formats encode real numbers as a sign bit, a biased radix-2 exponent, and a finite significand precision field.”
— Standard reference: IEEE 754-2019 — Standard for Floating-Point Arithmetic
Binary & Fractional Conversion Q&A
- How do you convert decimal to binary using repeated division by 2?
- Divide the integer part by 2 repeatedly and record each remainder (0 for even, 1 for odd) until the quotient hits 0. Reading those bits from bottom to top yields the exact binary result—for example, 25 produces remainders 1, 0, 0, 1, 1, which assemble upward into 11001.
- How does this decimal to binary converter handle decimal fractions like 13.625?
- It splits the input at the decimal point. The integer part (13) runs through repeated division by 2 to produce 1101, while the fractional part (0.625) uses repeated multiplication by 2—recording each integer carry top-to-bottom (1, 0, 1)—to form 1101.101.
- Why does 0.1 become a repeating binary fraction in computers?
- Just as 1/3 repeats endlessly in base 10 (0.333...), 1/10 cannot be written as a finite sum of negative powers of 2. Repeated multiplication by 2 enters a 4-bit cycle (0.000110011001...), which our binary converter displays alongside its rounded IEEE 754 single-precision float32 mantissa.
- How do negative integers convert in signed Two’s Complement mode?
- Select int8, int16, int32, or int64 in this binary converter and enter a negative value such as −128. The engine adds 2^w before dividing by 2 so the leftmost Most Significant Bit correctly encodes the negative sign weight.
- Does this binary converter lose precision on 64-bit numbers?
- No. All integer divisions use arbitrary-precision BigInt math, and fractional multiplications use exact scaled integer arithmetic rather than imprecise binary floats, eliminating rounding drift in step tables.