Q-Format to Decimal Converter
Convert Q-format fixed-point numbers to decimal values. Q-format (Qm.n) is widely used in digital signal processing (DSP) and embedded systems for efficient fixed-point arithmetic.
Converter
Number of integer bits
Number of fractional bits
Enter binary, hex (0x prefix), or decimal integer
How to Use This Tool
Select Q-Format
Choose a preset like Q15 or Q31, or enter custom m and n values for your specific format
Enter Your Value
Input your Q-format number as binary, hexadecimal (0x prefix), or decimal integer
View Results
See the decimal equivalent along with step-by-step calculation breakdown
Q-Format Formula
decimal = integer_value / 2nIn Q-format notation Qm.n, the number is represented with:
- m integer bits (excluding the sign bit for signed numbers)
- n fractional bits
- For signed numbers, an additional sign bit using two's complement
The total number of bits is m + n for unsigned, or m + n + 1 for signed numbers (including the sign bit).
For example, Q15 (or Q0.15) uses 16 bits total: 1 sign bit + 0 integer bits + 15 fractional bits. The range is -1.0 to +0.999969482421875 (approximately +1.0 - 2-15).
Frequently Asked Questions
What is Q-format and where is it used?
Q-format is a fixed-point number representation used extensively in digital signal processing (DSP), embedded systems, and audio/video codecs. It allows efficient arithmetic on processors without floating-point units by representing fractional values as scaled integers.
What's the difference between Q15 and Q1.15?
Q15 (also written as Q0.15) has 0 integer bits and 15 fractional bits, giving a range of -1 to nearly +1. Q1.15 has 1 integer bit and 15 fractional bits, extending the range to -2 to nearly +2. Both use 16 bits total when signed.
How do I convert a decimal back to Q-format?
To convert a decimal to Q-format, multiply by 2^n (where n is the number of fractional bits), then round to the nearest integer. For example, 0.5 in Q15 would be 0.5 x 32768 = 16384 (0x4000 in hex).
What input formats does this converter accept?
The converter accepts binary strings (e.g., 0111111111111111), hexadecimal with 0x prefix (e.g., 0x7FFF), or decimal integers (e.g., 32767). All formats represent the raw bit pattern of your Q-format value.