Skip to content

Free tool · FP32 · BF16 · FP16 · FP8 · FP4

AI number format converter

Type any number and see exactly how FP32, TF32, BF16, FP16, FP8 (E4M3 and E5M2) and FP4 (E2M1) store it: the rounded value, the error, and every sign, exponent and mantissa bit. It uses the same round-to-nearest-even rules as the hardware.

Key takeaways
  • Exponent bits set the range (how big or small a number can be); mantissa bits set the precision (how many significant digits survive).
  • FP16 overflows above 65,504; BF16 keeps FP32's range (up to about 3.4 × 10³⁸) with only about 3 significant digits.
  • FP8 E4M3 tops out at 448, E5M2 at 57,344, and FP4 E2M1 can only store 0, ±0.5, ±1, ±1.5, ±2, ±3, ±4 and ±6.

Accepts decimals and scientific notation, for example 0.1, -2.5, 65504 or 1e-8.

Colours: sign, exponent, mantissa. FP8 E4M3 follows the OCP "FN" variant (no infinity; overflow becomes NaN). FP4 E2M1 has no infinity or NaN, so values beyond ±6 are shown as out of range. TF32 is a Tensor Core compute format stored in 32-bit registers; its 19 meaningful bits are shown.

Format reference table

The numbers behind every format, using the IEEE 754 and OCP 8-bit floating point definitions.

FormatBitsExponentMantissaBiasLargest valueSmallest normalSmallest subnormalPrecision near 1
FP32IEEE 754 single328231273.40 × 10³⁸1.18 × 10⁻³⁸1.40 × 10⁻⁴⁵≈ 7 digits
TF32NVIDIA Tensor Core format19810127≈ 3.40 × 10³⁸1.18 × 10⁻³⁸–≈ 3 digits
BF16bfloat1616871273.39 × 10³⁸1.18 × 10⁻³⁸9.18 × 10⁻⁴¹≈ 2–3 digits
FP16IEEE 754 half165101565,5046.10 × 10⁻⁵5.96 × 10⁻⁸≈ 3 digits
FP8 E4M3OCP FP8, "FN"84374480.0156250.001953≈ 1 digit
FP8 E5M2OCP FP88521557,3446.10 × 10⁻⁵1.53 × 10⁻⁵< 1 digit
FP4 E2M1OCP MX / NVFP4 element4211610.58 values only

In practice, FP8 and FP4 are almost always used with scale factors: one scale per tensor or per small block (32 elements for OCP MXFP4, 16 for NVIDIA NVFP4), so the narrow range of each element covers real data. Learn how in FP16, BF16, FP8 and FP4 explained, or practise picking formats in the Bit Budget game.

How a floating-point number is stored

1. Sign

One bit: 0 for positive, 1 for negative.

2. Exponent

Stored with a bias. The real power of two is the stored exponent minus the bias, so more exponent bits mean a wider range.

3. Mantissa

The fraction after an implied leading 1. Value = (−1)sign × 2exponent − bias × (1 + mantissa ÷ 2bits).

When the stored exponent is zero, the number is subnormal: the implied 1 becomes 0, which lets the format represent values even closer to zero at reduced precision.

Frequently asked questions

Why does 0.1 change when stored in floating point?

0.1 has no exact binary representation, just as 1/3 has no exact decimal one. Every format stores the nearest value it can: FP32 stores 0.100000001490116, FP16 stores 0.0999755859375 and FP8 E4M3 stores 0.1015625.

What is the difference between FP16 and BF16?

Both use 16 bits. FP16 spends 5 bits on the exponent and 10 on the mantissa, so it is more precise but overflows above 65,504. BF16 spends 8 bits on the exponent like FP32, so it has the same huge range but only 7 mantissa bits. That range is why BF16 is the default for training large models.

Which FP8 format should I use?

E4M3 has more precision and is typically used for weights and activations in the forward pass. E5M2 has more range and is often used for gradients. NVIDIA's Transformer Engine picks between them per tensor.

Can FP4 really run an AI model?

Yes, with block scaling. Each block of 16 or 32 FP4 values shares a scale factor, so the eight representable magnitudes cover the actual range of the data. NVIDIA Blackwell and AMD MI355X both accelerate FP4 in hardware.

Sources

  1. IEEE 754-2019 standard for floating-point arithmetic
  2. OCP 8-bit Floating Point Specification (OFP8)
  3. OCP Microscaling (MX) Formats Specification v1.0
  4. Micikevicius et al., FP8 Formats for Deep Learning (2022)

Cite this tool

TensorCore.si Editorial. (2026, November). AI number format converter: FP32, BF16, FP16, FP8 and FP4. TensorCore.si. https://tensorcore.si/number-format-converter/