Quantization Error Calculator
Calculate the difference between an original real value and its quantized or dequantized approximation. Measure signed error, absolute error, relative error and percentage error.
Absolute error = |approximate – original|
Relative error = absolute error / |original|
What Is Quantization Error?
Quantization error is the numerical difference introduced when a value is represented using a limited set of discrete levels instead of its original higher-precision value.
When a real value is quantized and later reconstructed, the result may not exactly equal the original value. The difference between the two values is the quantization error.
Signed Quantization Error
Signed error preserves the direction of the difference:
A positive result means the approximation is higher than the original value. A negative result means it is lower.
Absolute Quantization Error
Absolute error measures only the size of the difference and ignores direction.
For example:
Approximate = 1.30
Absolute error = |1.30 – 1.25|
= 0.05
Relative Quantization Error
Relative error expresses the absolute error in relation to the magnitude of the original value.
This makes it easier to compare the significance of an error across values of different sizes.
Percentage Quantization Error
Percentage error expresses relative error as a percentage.
Using an original value of 1.25 and an approximate value of 1.30:
Relative error = 0.05 / 1.25 = 0.04
Percentage error = 4%
Positive and Negative Quantization Error
The sign of the error shows whether the quantized approximation overshoots or undershoots the original value.
Approximate = 10.2
Signed error = +0.2
Approximation is above the original.
Approximate = 9.8
Signed error = -0.2
Approximation is below the original.
What Happens When the Original Value Is Zero?
Relative and percentage error use the magnitude of the original value as the denominator. When the original value is zero, division by zero is undefined.
In that case, this calculator still reports signed and absolute error, but relative and percentage error are shown as undefined unless the values match exactly.
Why Quantization Error Matters
Quantization reduces numerical precision by mapping values to a finite set of representable levels. Measuring error helps determine how closely the lower-precision representation approximates the original data.
This is relevant in digital signal processing, numerical computing, data compression, embedded systems and low-precision machine-learning workflows.
Quantization Error and AI
Low-bit numerical formats such as INT8 and INT4 can reduce model storage and computational requirements, but quantized parameters may differ from the original floating-point values.
Quantization error provides a direct way to inspect how much numerical deviation has been introduced for an individual value.
Important Quantization Error Notes
It does not calculate quantization scale or zero point.
It does not convert the original value into INT8, INT4 or another quantized representation.
Signed error preserves whether the approximation is above or below the original.
Absolute error reports only the magnitude of the difference.
Relative and percentage errors are undefined when the original value is zero, except when both values are exactly zero.