Decimal floating-point → Binary (with rounding error)

This converter treats your input as an exact decimal rational (using BigInt), then produces a binary expansion with a chosen number of fractional bits. Many decimals (like 0.1) are repeating in binary, so any finite representation must round — the tool shows the resulting rounding error.

Binary result

Reconstructed value from those bits

This is the decimal value represented by the produced binary bits.

Rounding error

Error = (original exact decimal) − (reconstructed). Shows absolute and relative error.

Optional: what JavaScript Number stores (IEEE-754 double)

JavaScript Number is an IEEE-754 double. This section shows its stored value and the gap vs your exact decimal input. (This is separate from the “N fractional bits” representation above.)

JS Number value

Exact-decimal minus JS Number