Fixed-Point Q-Format Converter (Qm.n)
Convert between real numbers and fixed-point Qm.n representations (signed Qm.n or unsigned UQm.n) used in DSP, embedded, and FPGA work. Configurable integer bits (m) and fractional bits (n), three rounding modes (round-half-up, round-to-even, truncate), two overflow modes (saturate, wrap), live resolution (2^-n) and representable range, exact quantization error, raw stored integer in dec / hex / bin, a clickable bit grid with integer | fraction split, and presets (Q7, Q15, Q31, UQ8.8, UQ16.16). BigInt-correct, 100% client-side.
About Fixed-Point Q-Format Converter (Qm.n)
Convert between real numbers and fixed-point Qm.n representations (signed Qm.n or unsigned UQm.n) used in DSP, embedded, and FPGA work. Configurable integer bits (m) and fractional bits (n), three rounding modes (round-half-up, round-to-even, truncate), two overflow modes (saturate, wrap), live resolution (2^-n) and representable range, exact quantization error, raw stored integer in dec / hex / bin, a clickable bit grid with integer | fraction split, and presets (Q7, Q15, Q31, UQ8.8, UQ16.16). BigInt-correct, 100% client-side. Everything runs locally in your browser — your data never leaves your device.
How to use
- Enter your input in the tool above.
- Adjust any options to your preference.
- Use the Copy or Download buttons to save the result.
- Everything happens locally — your data never leaves your browser.
FAQ
What is Qm.n fixed-point notation?
Qm.n is a fixed-point notation where m is the number of integer bits (including the sign bit for signed formats) and n is the number of fractional bits. The total word length is m + n bits. So Q1.15 means 1 integer bit (the sign) + 15 fractional bits = 16 bits total, often abbreviated Q15. Q1.31 = 32 bits total (a.k.a. Q31). The fractional bits give a resolution (quantum) of 2^-n — Q15 has a resolution of 1/32768 ≈ 3.05e-5.
What is the difference between signed Qm.n and unsigned UQm.n?
Signed Qm.n uses two's-complement encoding for the integer bits, so the most-significant bit is the sign bit. The representable range is [-2^(m-1), 2^(m-1) - 2^-n]. Unsigned UQm.n has no sign bit and uses all m integer bits for magnitude, giving a range of [0, 2^m - 2^-n]. The tool supports both — toggle the Signed checkbox to switch.
What rounding and overflow modes are supported?
Three rounding modes: round-half-up (the schoolbook rule, ties go away from zero), round-to-nearest-even (the IEEE 754 default, ties go to the even LSB — eliminates bias), and truncate (floor toward negative infinity for signed, toward zero for unsigned). Two overflow modes: saturate (clamp to the representable range with an overflow warning) and wrap (two's-complement wraparound, the default CPU behavior).
What are the quantization error and resolution readouts?
Resolution (quantum, LSB weight) = 2^-n and is shown as both a fraction and a decimal. The quantization error is the exact difference between your typed real value and the value reconstructed from the stored integer — it is computed with BigInt so it is exact to the last digit, never a re-printed float. For rounding modes the error is bounded by ±0.5 LSB; for truncate it is in [-1, 0] LSB (signed) or [-1, 0] LSB (unsigned).
What extra features does this tool have versus other Q-format converters?
(1) Both signed Qm.n AND unsigned UQm.n with a single toggle (most assume signed only). (2) Three rounding modes (round-half-up, round-to-even, truncate) — most only do one. (3) Two overflow modes (saturate vs wrap) with an explicit warning flag. (4) Live resolution (2^-n) as both fraction and decimal. (5) Live representable range display. (6) Exact quantization error via BigInt (not a re-printed float). (7) Raw stored integer in decimal, hex, and binary simultaneously. (8) Clickable bit grid with integer | fraction bit split color-coded. (9) Q7 / Q15 / Q31 / Q1.15 / Q1.31 / UQ8.8 / UQ16.16 preset chips. (10) Real → Q and Q → real both directions. (11) History (localStorage, last 20). (12) Shareable URL with full state round-trip. 100% client-side and offline — your values never leave the device.
Related tools
.bashrc / .zshrc Alias & Config Manager
Build shell aliases, functions, exports, and PATH edits in a visual editor, then export a clean, commented .aliases file sourced from both .bashrc and .zshrc — with shadowing detection against shell builtins and common CLI tools, function suggestions when args are needed, starter packs (git, docker, kubectl, navigation, safety, ls, dev, devops, data science), import of existing rc files, dedupe, history (localStorage), and shareable URL. 100% client-side.
Add / Subtract Date Calculator
Add or subtract years, months, weeks, days, hours, minutes and seconds from a starting date/time. Calendar-day or business-day mode with custom weekend + holiday list. Month-end policy toggle (clamp to last day vs overflow). Repeat/series mode (e.g. every 2 weeks x 10) with CSV export. Shareable URL. 100% client-side.
Age Calculator
Calculate exact age from a birth date in calendar years/months/days (no negative-day bugs) plus totals in months/weeks/days/hours/minutes/seconds. Next-birthday countdown with weekday. Feb-29 birthday policy toggle. Milestones (1,000 days, 10,000 days, 1 billion seconds). Zodiac sign + Chinese zodiac. Age gap comparison. Shareable URL. 100% client-side.