Fixed-Point (Q-format) Converter — Qm.n, Two's Complement, Quantization Error

Convert a real number to and from its fixed-point Qm.n representation: choose integer bits, fractional bits and signed (two's complement) or unsigned. See the raw stored integer in decimal, binary and hex, the actual value represented, the quantization error, the resolution and the representable range — live in your browser.

Converter Number Systems Updated Jun 21, 2026
How to Use
  1. Set the integer bits (m), fractional bits (n) and whether the format is signed (two's complement) or unsigned.
  2. Type a real number in the "Real value" box to see its raw stored integer, the value actually represented and the rounding error.
  3. Or type a raw integer (decimal) or hex word into the "Raw stored value" box to decode it back into a real number.
  4. Click any value (or its Copy button) to copy it. Out-of-range inputs are flagged and clamped.
Q8.8
e.g. 3.14159, -2.5
Edit either box — the other follows

Why fixed-point, and what Qm.n means

Many digital signal processors and low-cost microcontrollers have no floating-point unit, yet still need to handle fractional quantities — audio samples, filter coefficients, sensor readings. The trick is to store those values as ordinary integers and agree, by convention, where the binary point sits. Q-format captures that convention: Qm.n reserves m bits for the integer part and n bits for the fraction. A value is stored by scaling it up by 2ⁿ and rounding to a whole number, so all the fast integer hardware can add, subtract and shift it directly. To recover the real value you simply divide by 2ⁿ again. Q8.8 packs into 16 bits with the point in the middle; Q0.15 spends every bit on precision for values in roughly ±1; Q16.16 is a classic 32-bit fixed-point used in graphics and games.

Rounding, range and the quantization error

Because the stored value must be a whole number, the formula raw = round(x · 2ⁿ) almost never lands exactly on your input. The gap between the value actually represented (raw / 2ⁿ) and the number you typed is the quantization error, and it can never exceed half the resolution, 2⁻ⁿ. Adding fractional bits halves that error each time. The integer bits, meanwhile, set the range: an unsigned format reaches 2ᵐ − 2⁻ⁿ, while a signed format stores negatives in two's complement — the top bit becomes a sign bit and a value of −x is held as 2^(m+n) − x·2ⁿ, giving a range of −2^(m−1) up to 2^(m−1) − 2⁻ⁿ. Push a number past those limits and it must be clamped; this tool flags that so a silent overflow doesn't surprise you on hardware.

Quick reference

Encode
raw = round(x · 2ⁿ)
Decode
x = raw / 2ⁿ
Resolution
2⁻ⁿ (one LSB)
Unsigned range
0 … 2ᵐ − 2⁻ⁿ
Signed range
−2^(m−1) … 2^(m−1) − 2⁻ⁿ
Two's complement
store −x as 2^(m+n) − x·2ⁿ
Q8.8, 1.5
raw 384 = 0x0180
Q4.4, −2.5
raw −40 → 0xD8

About the Fixed-Point (Q-format) Converter — Qm.n, Two's Complement, Quantization Error

The Fixed-Point (Q-format) Converter — Qm.n, Two's Complement, Quantization Error gives you a fast, free answer for everyday tasks without sending anything off your device. Convert a real number to and from its fixed-point Qm.n representation: choose integer bits, fractional bits and signed (two's complement) or unsigned. See the raw stored integer in decimal, binary and hex, the actual value represented, the quantization error, the resolution and the representable range — live in your browser.

How it works

Type a value, then pick what you want to change it into. The answer appears straight away. It all happens on your own device, so it is fast and nothing you type is sent away. Just check that you picked the right “from” and “to” so you get the answer you wanted.

Want the deeper story? The Knowledge Base explains the ideas behind the tools in more detail.

Frequently Asked Questions

What does Qm.n mean?

Q-format describes a fixed-point number by how many bits sit on each side of an imaginary binary point: m integer bits and n fractional bits. Q8.8 has 8 integer and 8 fractional bits (16 bits total); Q0.15 has no integer bits and 15 fractional bits plus a sign bit. The fractional bits give a fixed resolution of 2⁻ⁿ.

How is the stored integer computed?

A real value x is scaled up by 2ⁿ and rounded to the nearest whole number: raw = round(x · 2ⁿ). To read it back you divide by the same factor: value = raw / 2ⁿ. Because raw must be an integer, most real numbers cannot be stored exactly — the difference (represented − input) is the quantization error.

What is the difference between signed and unsigned?

Unsigned formats store only non-negative values across the full word. Signed formats use two's complement: the top bit is a sign bit, negative values are stored as 2^(m+n) + raw, and the representable range is roughly −2^(m−1) to +2^(m−1) − 2⁻ⁿ. This tool highlights the sign bit and shows the two's-complement word for negative inputs.

What is the resolution and range of a Q-format?

The resolution (smallest step) is always 2⁻ⁿ, set purely by the fractional bits. The range is set by the integer bits and the sign: an unsigned Qm.n covers 0 to 2ᵐ − 2⁻ⁿ, while a signed Qm.n covers −2^(m−1) to 2^(m−1) − 2⁻ⁿ. More fractional bits buy precision; more integer bits buy headroom.

Is anything uploaded?

No. Every conversion runs locally in your browser with JavaScript — nothing is sent to a server.

How do I use the Fixed-Point (Q-format) Converter — Qm.n, Two's Complement, Quantization Error?

Just type or paste your value. The answer shows up right away — there is no button to press. Change anything and it updates by itself.

Does it cost anything or need an account?

No. The tool is completely free, there is no account to create, and it keeps working offline after the page first loads.

Is anything I type uploaded?

No. The tool works entirely on your device, so the values you enter never leave your browser.

Common Use Cases

DSP & audio

Pick a Q-format for filter coefficients or samples on a fixed-point DSP and see exactly how much precision and headroom you get.

Embedded without an FPU

Represent fractional values with plain integers on a microcontroller, and check the rounding error before you ship.

Decoding register values

Take a raw 16- or 32-bit word from a sensor or fixed-point register and turn it back into a real-world quantity.

Learning two's complement

Watch the sign bit and the two's-complement word change as you sweep a value negative — with the binary shown bit by bit.

Last updated: