Fixed-point Q format converter

Converting control-loop or DSP constants to Q15 or Q31 by hand invites rounding and saturation bugs. Convert real values to and from Qm.n fixed point, with resolution, range and saturation flags.

Open the calculator in EM·LINKBelow is a worked example. The working calculator runs free in EM·LINK.

Worked example

Example inputs

0.70710678
Q15 (signed 16 bit)▾
Round to nearest▾
Real to fixed point▾

Example result

Q15 raw value231700x5A82

Converts back to 0.7070923, an error of −1.45 × 10⁻⁵. Not saturated.

FormatRawHexBack
Q15231705A820.7070923
Q3115185002475A8279970.7071068
Q1.14115852D410.7070923
Q7.818100B50.7070313

Q15 resolution 3.05 × 10⁻⁵, range −1 to 0.99997.

Conversion runs in your browser. Nothing is sent to us.

Run it with your own values

The working calculator is Fixed-Point Q Converter in EM·LINK, our free browser tool. The button opens it directly.

Open in EM·LINK

How to read the result

Example: 0.75 in Q15 is 24576, or 0x6000.

Multiplying two Qm.n values gives Q2m.2n; shift right by n to get back.

How this is calculated

The real value is scaled by 2 to the power n and rounded to an integer. Going back divides by the same factor, and the difference is the rounding error.

raw = round(x × 2^n) back = raw × 2^-n resolution = 2^-n signed range: -2^m to 2^m - 2^-n

The full derivation, step by step, is in the EM·LINK documentation.

Calculated per common engineering practice (Qm.n fixed-point notation). These tools are an engineering aid, not a certification.

Next step

Shipping hundreds of units? Get OTA updates and remote config without building it yourself.

Common questions

What is 0.75 in Q15?

24576, which is 0x6000.

What does SATURATED mean?

The value is outside the Q format range and clips.

Signed or unsigned?

Both are supported.