FP8 Converter
Convert decimal values to an 8-bit floating-point representation or decode an FP8 bit pattern back to decimal. Choose E4M3 or E5M2 format and inspect the sign, exponent, fraction, binary and hexadecimal representation.
What Is FP8?
FP8 is an eight-bit floating-point representation designed for numerical workloads where reducing memory use, data movement and computational cost is more important than retaining high precision.
Unlike larger floating-point formats, FP8 provides very few bits for both exponent and fraction information. Two widely discussed layouts are E4M3 and E5M2.
FP8 E4M3 and E5M2
| Format | Sign | Exponent | Fraction | Bias |
|---|---|---|---|---|
| E4M3 | 1 bit | 4 bits | 3 bits | 7 |
| E5M2 | 1 bit | 5 bits | 2 bits | 15 |
E4M3 dedicates more of its limited bit budget to significand precision, while E5M2 dedicates more bits to the exponent and therefore supports a wider exponent range.
FP8 Bit Layout
S | EEEE | FFF
E5M2:
S | EEEEE | FF
The first bit is the sign. The following bits contain the biased exponent, and the remaining low-order bits store the fraction.
Decimal to FP8 Example
The decimal value 1.5 can be represented exactly in both layouts because its normalized binary value is 1.1 × 2⁰.
1.1 × 2^0
E4M3:
0 | 0111 | 100
Complete:
00111100
Hex:
3C
Why FP8 Rounds Values
FP8 stores only two or three explicit fraction bits depending on the selected format. Consequently, many ordinary decimal values cannot be represented exactly.
The converter selects the nearest representable finite FP8 value for decimal inputs. The decoded result therefore may differ slightly from the original decimal value.
Why FP8 Matters in AI Computing
Low-precision floating-point representations are increasingly relevant to machine-learning computation because large neural-network workloads move and process enormous quantities of numerical data.
Reducing each value to eight bits can substantially reduce storage and bandwidth requirements compared with 16-bit or 32-bit representations when the workload and hardware support the selected FP8 format.
This calculator focuses only on understanding and converting the underlying FP8 numeric representation.
E4M3 vs E5M2
| Property | E4M3 | E5M2 |
|---|---|---|
| Total bits | 8 | 8 |
| Exponent bits | 4 | 5 |
| Fraction bits | 3 | 2 |
| Exponent bias | 7 | 15 |
| Main trade-off | More precision | More exponent range |
Important FP8 Notes
This calculator supports E4M3 and E5M2 layouts.
E4M3 contains 1 sign bit, 4 exponent bits and 3 fraction bits.
E5M2 contains 1 sign bit, 5 exponent bits and 2 fraction bits.
Because FP8 precision is very limited, decimal-to-FP8 conversion frequently requires rounding.
Exact handling of the highest exponent patterns can vary among specific FP8 standards and hardware implementations. This educational converter uses conventional IEEE-like finite/subnormal/infinity/NaN interpretation for the selected bit layout.