INT8 Quantization Calculator
Quantize a decimal value to signed INT8 using a scale and zero point. Calculate the integer code, 8-bit binary representation, dequantized value and resulting quantization difference.
q is clamped to the signed INT8 range -128 to 127.
What Is INT8 Quantization?
INT8 quantization maps a real-valued number to a signed 8-bit integer. A signed INT8 value can contain any whole number from -128 through 127.
Instead of storing the original floating-point value directly, the quantized representation stores an integer code together with scale and zero-point parameters that define how the integer corresponds to the real numerical range.
INT8 Quantization Formula
The basic affine quantization equation used by this calculator is:
Here, x is the original real value and q is the resulting signed INT8 integer. After rounding, the value is limited to the valid range from -128 through 127.
To estimate the represented real value again, dequantization uses:
INT8 Quantization Example
1.25
Scale:
0.1
Zero point:
0
1.25 / 0.1 = 12.5
Rounded INT8:
13
Binary:
00001101
Dequantized:
13 × 0.1 = 1.3
The represented value is 1.3 rather than exactly 1.25 because only discrete integer codes are available after quantization.
Signed INT8 Range
| Property | Value |
|---|---|
| Storage width | 8 bits |
| Minimum | -128 |
| Maximum | 127 |
| Total integer codes | 256 |
| Negative representation | Two’s complement |
What Does Scale Mean?
The scale determines how much real-value distance exists between neighboring quantized integer codes. A smaller scale represents finer numeric steps, while a larger scale represents larger steps.
One INT8 step represents:
0.1 real-value units
The scale must always be greater than zero.
What Is the Zero Point?
The zero point is the quantized integer code associated with real zero in affine quantization.
Zero point = 5
Real value 0:
round(0 / 0.1) + 5
= 5
The zero point is useful when the quantized integer range and the represented real range are not centered around zero.
INT8 Clamping
If the calculated integer is greater than 127, it cannot be stored in signed INT8 and is clamped to 127. Values below -128 are similarly clamped to -128.
INT8 maximum = 127
Stored q = 127
Clamping prevents the quantized integer from exceeding the signed 8-bit storage range.
INT8 Binary Representation
The resulting quantized integer is displayed as a complete 8-bit binary value. Negative INT8 values use two’s-complement representation.
-5
8-bit two’s complement:
11111011
Why INT8 Quantization Is Used
Lower Storage
An INT8 value requires only one byte, which can substantially reduce numerical data storage compared with wider floating-point representations.
Lower Memory Traffic
Smaller numerical representations reduce the amount of data that must be moved between memory and compute units.
Integer Computation
Compatible processors and accelerators can use efficient low-precision integer arithmetic for quantized workloads.
AI Inference
INT8 quantization is commonly associated with optimized machine-learning inference where reduced precision is acceptable.
Important INT8 Quantization Notes
The INT8 output range is -128 through 127.
The scale must be greater than zero.
The zero point must itself fit within the signed INT8 range.
Quantization requires rounding because a real value may fall between two integer codes.
If the calculated result exceeds the INT8 range, it is clamped to -128 or 127.
The dequantized value is an approximation represented by the resulting INT8 code; it does not create additional precision.