Convert between decimal values and fixed-point Qm.n binary, where n fraction bits give a resolution of 1/2ⁿ – the format of DSPs and FPGAs that have no floating-point unit.
Show calculation steps
Processed privately in your browser — nothing you paste is uploaded, logged or stored.
Fractions on integer hardware
Fixed-point arithmetic stores a real number as an integer times a fixed scale: in Qm.n format, the integer is round(value × 2ⁿ), kept in m+n bits with an implied binary point n places from the right. Addition stays ordinary integer addition; only interpretation changes.
This converter moves both directions — decimal to pattern with rounding disclosed, pattern to exact decimal — for Q formats built from 4/8/16-bit fields, signed or unsigned.
Worked example
Encode 5.75 in Q8.8: 5.75 × 256 = 1472 (exact — no rounding needed) 1472 = 00000101 11000000 Shown as: 00000101 . 11000000 Decode back: 1472 / 256 = 5.75 ✓
| Format | Range (signed) | Resolution |
|---|---|---|
| Q4.4 | −8 … +7.9375 | 0.0625 |
| Q8.8 | −128 … +127.996 | 0.00390625 |
| Q16.16 | −32768 … +32767.99998 | 1/65536 |
Resolution is the whole game
A Q format quantises to steps of 1/2ⁿ: values between steps round to the nearest, and the tool states the exact stored value whenever that happens. Choosing n is choosing your error budget; choosing m is choosing your range — overflow beyond it is rejected here with the representable bounds named, where hardware would wrap or saturate.
Where fixed point rules
DSP audio paths, FPGA arithmetic, motor control loops, and any microcontroller without an FPU. Determinism is the second draw: identical results on every platform, no rounding-mode surprises — why financial and safety-critical niches sometimes prefer it even where floats exist.
Privacy
Scaling and rounding are computed locally; your values never leave the page.
How to use the Fixed-Point Binary Converter
- Choose the Q format – integer bits (m) and fraction bits (n) – and signedness.
- Pick the direction: decimal to bits, or bits to decimal.
- Enter the value and click "Convert".
- The steps show the scale factor 2ⁿ at work, and the result marks the binary point between the fields.
Frequently asked questions
What is Qm.n fixed-point notation?
A convention that stores a real number as the integer round(value × 2ⁿ) in m+n bits: m bits carry the integer range, n bits the fraction. Q8.8 stores 5.75 as the integer 1472, whose bits read 00000101.11000000 with an implied point.
What is the resolution of a Q format?
One part in 2ⁿ: Q8.8 steps by 1/256 ≈ 0.0039. Any value between steps is rounded to the nearest step, and the tool tells you the exact stored value when rounding occurred.
Why use fixed point instead of floating point?
Determinism and hardware cost: DSPs, FPGAs and many microcontrollers have no FPU, and fixed-point addition is exact integer addition with no exponent alignment. Audio pipelines and control loops still run on it heavily.
How do negative values work here?
The underlying integer is stored in two's complement across the whole m+n field: −2.5 in Q4.4 is round(−2.5×16) = −40 → 11011000, shown as 1101.1000. Signed range at Q4.4 is −8 to +7.9375.
What happens if my value exceeds the format range?
A clear error with the exact representable range – not silent wraparound. Real hardware often DOES wrap or saturate, which is precisely why choosing m correctly matters at design time.
How is this different from the IEEE-754 converter?
Fixed point has a constant resolution everywhere; floating point trades a variable exponent for enormous range with relative precision. The two pages together show the same value under both regimes – instructive to compare.
Where does the fixed-point conversion run?
Locally – the scaling and rounding are BigInt-exact in your browser, nothing transmitted.