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
Example result
Converts back to 0.7070923, an error of −1.45 × 10⁻⁵. Not saturated.
| Format | Raw | Hex | Back |
|---|---|---|---|
| Q15 | 23170 | 5A82 | 0.7070923 |
| Q31 | 1518500247 | 5A827997 | 0.7071068 |
| Q1.14 | 11585 | 2D41 | 0.7070923 |
| Q7.8 | 181 | 00B5 | 0.7070313 |
Q15 resolution 3.05 × 10⁻⁵, range −1 to 0.99997.
Conversion runs in your browser. Nothing is sent to us.
The working calculator is Fixed-Point Q Converter in EM·LINK, our free browser tool. The button opens it directly.
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.
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.
Related tools
- Number and bit inspector, to see the raw value bit by bit.
- Timer and PWM register, to turn a controller output into a duty cycle.
- C struct layout and padding, to lay out tables of fixed-point constants.