Binarios.org

Fixed-Point Converter

Convert decimal values into fixed-point binary, hexadecimal, and stored integers. Configure total word width, fractional bits, signed or unsigned interpretation, rounding, and overflow behavior. This calculator is useful for embedded programming, digital signal processing (DSP), microcontrollers, FPGA logic, and Q-format arithmetic.

Fixed-Point / Q-Format Calculator

Enter a decimal number, such as 0.75, -1.25, or 12.5.

Overflow policy affects encoding. Decoding always interprets the supplied word at the selected width.

Conversion result

Stored binary word

Signed stored integer
Unsigned raw code
Hexadecimal word
Exact represented value
Quantization error (represented − requested)
Resolution (one LSB)
Representable range
Scale factor
Format
Status

Calculation steps

    Quick examples:

    What Is Fixed-Point Representation?

    Fixed-point representation stores a number as an integer with an implied binary point. The point is not physically stored in the word. Instead, the number of fractional bits determines the scale used to interpret the stored integer.

    Core formula:
    Represented value = stored integer ÷ 2F
    where F is the number of fractional bits.

    For example, if F = 8, each integer step represents 1/256, or 0.00390625. A stored integer of 384 represents 384/256 = 1.5.

    Signed and unsigned fixed-point values

    In signed mode, the stored integer uses two's complement. For a word of W bits, its integer range is from −2W−1 to 2W−1 − 1. In unsigned mode, the range is from 0 to 2W − 1. Dividing those endpoints by 2F gives the representable real-value range.

    Common fixed-point formats

    FormatTotal bitsFraction bitsExample use
    Q787Compact coefficients and small values
    Q15 / Q1.151615Audio and DSP coefficients
    Q31 / Q1.313231Higher precision DSP calculations
    Q8.8168General embedded calculations
    Q16.163216Control systems and graphics

    Q-format labels are not universal. Some conventions count the sign bit as part of the integer-bit count, while others do not. This calculator avoids that ambiguity by specifying the total word width, fractional bits, and signedness independently.

    Rounding and quantization error

    A decimal value is encoded by multiplying it by 2F and converting the scaled value to an integer. If the result is not an integer, a rounding rule determines which stored integer is chosen. The difference between the represented value and the requested value is the quantization error.

    What happens when a value is out of range?

    Frequently Asked Questions

    How do I convert a decimal number to fixed-point binary?

    Choose the word width and fractional-bit count, multiply the decimal value by 2F, apply the selected rounding and overflow rules, then encode the resulting integer into the selected-width binary word.

    What does Q15 mean?

    In this calculator, Q15 means a signed 16-bit two's complement value with 15 fractional bits. Its scale is 32768, and its representable range is −1 through 1 − 1/32768. The positive value +1 cannot be represented in this format.

    Why is the represented value different from my input?

    Fixed-point formats have a finite resolution. If the input does not fall exactly on a representable step, rounding selects a nearby value. The calculator reports the quantization error.

    When should I use fixed-point instead of floating-point?

    Fixed-point can be useful on microcontrollers, DSPs, FPGAs, and embedded systems where predictable integer arithmetic, defined scaling, or hardware without floating-point support is important. The available range and precision must be chosen carefully.

    Related Binarios.org Tools