Q Advanced Fixed-Point Tool

Q-Format Binary Converter

Convert Q-format binary values to decimal or encode decimal values into Q-format binary. Configure integer bits, fractional bits and signed or unsigned representation while checking numeric range, scale, resolution and quantization.

Qm.n Conversion Binary to Decimal Decimal to Binary Signed & Unsigned Quantization
Q-Format Conversion Browser Based

Q Binary to Decimal

Decode a raw Q-format binary word into its decimal value.

Binary to Decimal Result
Raw Bits
Q Binary
Stored Integer
Scale
Resolution
Range

Decimal to Q Binary

Encode a decimal number into a selected Q-format binary word.

Decimal to Q Binary Result
Raw Bits
Stored Integer
Represented Value
Quantization Error
Scale
Resolution

What Is Q-Format Binary?

Q format is a fixed-point binary representation used to store fractional numbers with a predetermined binary-point position. Instead of storing an exponent, a fixed number of bits is allocated to the integer and fractional parts.

Under the convention used by this converter, a format such as Q4.4 contains four integer-related bits and four fractional bits. In signed mode, the integer-bit count includes the sign bit.

Because the binary point remains fixed, Q-format numbers can perform fractional calculations using integer hardware and fixed-width registers.

Q-Format Conversion Formulas

Q Binary to Decimal

Interpret the raw binary bits as an unsigned or signed stored integer, then divide by the scale.

Scale = 2^n
Decimal = Stored Integer / Scale

Decimal to Q Binary

Multiply the decimal input by the scale and round the result to the nearest stored integer.

Stored Integer = round(Decimal x 2^n)
Represented Value = Stored Integer / 2^n

Q-Format Resolution Reference Table

Resolution is the smallest step between adjacent representable Q-format numbers. Every additional fractional bit divides the resolution by two.

Fractional Bits Scale Resolution Calculation
0 1 1 1 / 1
1 2 0.5 1 / 2
2 4 0.25 1 / 4
3 8 0.125 1 / 8
4 16 0.0625 1 / 16
8 256 0.00390625 1 / 256
12 4096 0.000244140625 1 / 4096
15 32768 0.000030517578125 1 / 32768

Common Q-Format Range Examples

Format Mode Total Bits Resolution Minimum Maximum
UQ2.2 Unsigned 4 0.25 0 3.75
Q2.2 Signed 4 0.25 -2 1.75
UQ4.4 Unsigned 8 0.0625 0 15.9375
Q4.4 Signed 8 0.0625 -8 7.9375
UQ8.8 Unsigned 16 0.00390625 0 255.99609375
Q8.8 Signed 16 0.00390625 -128 127.99609375

Worked Example 1: UQ4.4 Binary to Decimal

Raw binary: 01011010
Format: UQ4.4
Stored integer: 90
Scale: 2^4 = 16
Decimal value: 90 / 16 = 5.625
Q notation: 0101.1010
Answer: 5.625

Worked Example 2: Signed Q4.4 Binary to Decimal

Raw binary: 11000100
Unsigned interpretation: 196
8-bit two’s complement: 196 – 256 = -60
Scale: 16
Decimal value: -60 / 16 = -3.75
Answer: -3.75

Worked Example 3: Decimal to UQ4.4

Decimal input: 6.375
Scale: 2^4 = 16
Scaled integer: 6.375 x 16 = 102
102 binary: 01100110
Q notation: 0110.0110
Represented decimal: 6.375
Quantization error: 0

Worked Example 4: Q-Format Quantization

When a decimal input is not an exact multiple of the selected Q-format resolution, it must be quantized.

Decimal input: 1.10
Format: UQ4.4
Resolution: 0.0625
Scale: 16
Exact scaled value: 17.6
Rounded stored integer: 18
Represented value: 18 / 16 = 1.125
Quantization error: 0.025
Q binary: 0001.0010

Signed vs Unsigned Q Format

Feature Unsigned Q Format Signed Q Format
Negative values No Yes
Sign encoding None Two’s complement
Minimum value 0 Negative
Positive range Larger Reduced by sign storage
Resolution Controlled by fractional bits Controlled by fractional bits
Common use Positive quantities Signals and signed measurements

Choosing Integer and Fractional Bits

Integer Bits

More integer bits increase the maximum representable magnitude but do not improve fractional resolution.

Fractional Bits

More fractional bits increase precision by creating smaller representable steps.

Fixed Word Width

With a fixed hardware width, increasing fractional precision often reduces the number of bits available for integer range.

Range vs Precision

Selecting an appropriate Q format is therefore a trade-off between numerical range and fractional accuracy.

Where Q-Format Binary Is Used

Digital Signal Processing

Q formats are widely used for filters, audio processing, communications and real-time signal algorithms.

Embedded Systems

Microcontrollers can process fractional quantities using fixed-width integer arithmetic.

FPGA Designs

Fixed bit widths and known binary-point positions map naturally to hardware registers and arithmetic pipelines.

Control Systems

Predictable numeric precision can be useful in deterministic real-time control applications.

Motor Control

Q-format values can represent normalized currents, voltages, speed, position and control-loop coefficients.

Audio Processing

Signed fractional Q formats can efficiently represent samples, coefficients and intermediate signal values.

Q Format vs Floating-Point

Feature Q-Format Fixed Point Floating Point
Binary point Fixed Controlled by exponent
Numeric range Limited Very large
Resolution Constant Changes with magnitude
Storage Scaled integer Sign, exponent and significand
Hardware Often simpler More complex
Typical use DSP, MCU, FPGA General and scientific computing

Important Q-Format Considerations

Important: Q-format naming conventions are not completely universal. Some references count the sign bit separately, while others include it in the integer-bit count. This calculator includes the sign bit within the integer-bit setting when signed mode is selected.

Always confirm the Q-format convention used by the processor, DSP library, FPGA design or software specification you are working with.

Decimal-to-Q conversion can also introduce quantization error because only values separated by the selected resolution can be represented exactly.

Related BinaryCon Tools

Q-Format Binary Converter FAQs

What is Q-format binary?
Q format is a fixed-point binary representation that allocates a defined number of bits to integer and fractional portions of a number.
What does Q4.4 mean?
Under the convention used by this converter, Q4.4 contains four integer-related bits and four fractional bits, producing an eight-bit representation.
How do I convert Q-format binary to decimal?
Interpret the raw bits as the appropriate signed or unsigned stored integer, then divide by 2 raised to the number of fractional bits.
How do I convert decimal to Q-format binary?
Multiply the decimal value by 2 raised to the fractional-bit count, round the result to a stored integer and encode that integer into the required binary width.
What is the resolution of Q4.4?
Four fractional bits give a resolution of 1 divided by 16, or 0.0625.
What is the signed Q4.4 range?
Under this converter’s convention, signed eight-bit Q4.4 ranges from -8 to 7.9375.
Can Q format represent negative values?
Yes. Signed Q formats commonly use two’s-complement encoding for negative stored integers.
What is quantization error?
Quantization error is the difference between the original decimal value and the value that can actually be represented using the selected Q-format resolution.
Why do more fractional bits improve precision?
Every additional fractional bit halves the numeric resolution, allowing smaller differences between adjacent representable values.
Does every system use the same Q-format convention?
No. Sign-bit counting conventions can differ. Check the documentation for the processor, DSP library or hardware design you are using.
Is Q-format the same as floating-point?
No. Q-format keeps the binary point in a fixed position, while floating-point representation uses an exponent to adjust the effective binary-point position.
Why is Q-format useful for DSP?
It allows fractional calculations to use fixed-width integer arithmetic, which can provide efficient and predictable processing in DSP and embedded hardware.
Scroll to Top