Fixed-point converter

Float ↔ fixed in any Q-format. Pick a word width and Q-factor — the integer-bits exponent E, the value range and the LSB follow — then convert a value with your choice of rounding and saturation.

For a signed N-bit type the Q-factor (fractional bits) and the integer-bits exponent E satisfy E = (N − 1) − Q. Edit either field — the other follows. Direction picks which way to convert; both single-value and bulk inputs apply the same format, rounding, and direction settings live below.

Format

Conversion

Value(s)

Enter a single number for the per-value readout, or two or more comma- / whitespace-separated values for the table + plot. Rounding only affects values that can't be represented exactly at the chosen Q — e.g. ``0.5`` at Q15 is exact, so every rounding mode gives the same int; try ``0.1`` to see the rounding pick up 3277 vs 3276.

What the result means

← All tools