Fixed-Point Converter

Convert numbers to and from fixed-point Q formats such as Q1.15, Q4.12 and Q16.16. Choose the word size, fraction bits and rounding, and see the raw integer, the stored value and the error.

Converter Number Systems Updated Oct 3, 2026
How to Use
  1. Choose value to raw to encode a number, or raw to value to read a stored integer.
  2. Set the word size and the number of fraction bits, and whether the format is signed; the presets cover common Q formats.
  3. Pick the rounding: nearest (ties to even), truncate or floor.
  4. Type the value, or the raw integer in decimal or hex.
  5. Read the hex, the raw integer, the stored value and the error; the drawing splits the bits at the binary point.
Input
two’s complement
Presets
Integer and fraction bits
Hex
—
Raw integer
—
Value
—
Error
—

Worked Example

π in Q4.12 (16-bit signed, 12 fraction bits). Scale by 2¹² = 4,096: 3.14159265 × 4,096 = 12,867.96. Round to the nearest integer: 12,868, which is 0x3244. Reading it back, 12,868 ÷ 4,096 = 3.1416015625, about 0.00001 more than π. The range of Q4.12 is −8 to 7.999756, in steps of 1/4,096.

A negative value: 0xC000 in Q1.15. As a signed 16-bit integer 0xC000 is 49,152 − 65,536 = −16,384, and −16,384 ÷ 32,768 = −0.5.

The common mistake: chopping instead of rounding. Truncating 0.1 to 23 fraction bits stores 0.099999904632568359375, short by about 9.5 × 10⁻⁸. That sounds harmless, but a clock that adds it every tenth of a second drifts by 0.34 s in 100 hours, the error behind the 1991 Patriot missile failure at Dhahran. Rounding to nearest halves the worst-case error and lets errors cancel instead of building up.

Show Work

Enter a value to see the step-by-step working.

Formulas

Encode
raw = round(x × 2F)
Decode
x = raw ÷ 2F
Signed range
−2W−1−F … 2W−1−F − 2−F
Q1.15: −1 … 0.99997
Resolution
2−F
the same at every value
Multiply
(a × b) >> F
with a double-width product

Integers in Disguise

Before floating-point hardware was cheap, almost all scientific and signal-processing code ran in fixed point: the programmer kept track of where the binary point was, and the machine only ever saw integers. Digital signal processors such as Texas Instruments’ TMS320 family, introduced in 1983, were built around 16-bit Q15 arithmetic with saturating adders, and many audio codecs, modems and motor controllers still are.

Fixed point is also behind classic game engines: the original Doom (1993) used 16.16 fixed point for positions and angles because PCs of the day were far faster at integer arithmetic. Today it lives on in microcontrollers, FPGAs and quantised neural networks, where 8-bit integers with a scale factor stand in for floats.

About This Calculator

This converter encodes numbers into any fixed-point format, signed or unsigned, with up to 64 bits and any number of fraction bits, using round-to-nearest-even, truncation or floor, and saturating values that are out of range. It also decodes raw integers in decimal or hex. It shows the raw integer, the hex, the value stored and the exact error, with the format’s range and resolution.

Everything runs in your browser; nothing is sent anywhere. The arithmetic is exact, so the error shown is the true error, not a floating-point estimate.

Related calculators: Binary Fraction Converter, Two’s Complement Converter, and IEEE 754 Float Converter.

Frequently Asked Questions

What is fixed-point arithmetic?

Storing a fractional number as an ordinary integer with an agreed scale. In Q4.12 the integer is divided by 2¹² = 4096, so 12,868 means 3.1416015625. Addition and subtraction are plain integer operations, which is why fixed point is used on microcontrollers and DSPs without a floating-point unit.

What does Q15 or Q1.15 mean?

The number after the point is the fraction bits. ARM-style Qm.n gives the integer bits including the sign, so Q1.15 is a 16-bit signed format with 15 fraction bits, ranging from −1 to 0.99997. TI writes the same format as Q15, counting only the fraction bits. Unsigned formats are often written UQm.n.

How do I convert a number to fixed point?

Multiply by 2 to the power of the fraction bits and round to an integer. 0.5 in Q1.15 is 0.5 × 32,768 = 16,384 = 0x4000. To read it back, divide by the same power of two. Values outside the range must be saturated (clamped) or they wrap round.

How precise is a fixed-point format?

The step between values is constant, 2^−F: 1/32,768 ≈ 0.0000305 in Q1.15, and 1/65,536 ≈ 0.0000153 in Q16.16. Unlike floating point, the absolute error is the same everywhere, so small values lose relative precision and large values cannot exceed the integer range.

How do you multiply fixed-point numbers?

Multiply the raw integers into a double-width result and shift right by F to restore the scale. Two Q1.15 values give a Q2.30 product, which is shifted right by 15 (with rounding) to get back to Q1.15. Forgetting the shift, or the double-width intermediate, is a classic overflow bug.

How do I use the Fixed-Point Converter?

Just type or paste your value. The answer shows up right away — there is no button to press. Change anything and it updates by itself.

Does it cost anything or need an account?

No. The tool is completely free, there is no account to create, and it keeps working offline after the page first loads.

Is anything I type uploaded?

No. The tool works entirely on your device, so the values you enter never leave your browser.

Common Use Cases

Audio DSP

0.5 in Q1.15 is 0x4000; −0.5 is 0xC000.

Microcontrollers

π in Q4.12 is 0x3244 = 3.1416015625, about 9 × 10⁻⁶ above π.

Graphics and games

1.5 in 16.16 fixed point is 0x00018000.

A famous bug

0.1 chopped to 23 fraction bits loses 9.5 × 10⁻⁸ per tick: 0.34 s after 100 hours.

Last updated: