FP4 E2M1 - 4-Bit Floating Point

4-bit OCP floating-point format with only 16 possible values

Bit Layout

Sign
S
1 bit
Exponent
E
E
2 bits
Mantissa
M
1 bit

FP4 E2M1 packs a floating-point number into just 4 bits. With 1 sign bit, 2 exponent bits, and just 1 mantissa bit, it can represent only 16 distinct values (8 positive, 8 negative including ±0).

Overview

FP4 E2M1 is defined in the OCP Microscaling Specification as the smallest element format for microscaling blocks. At 4 bits per element, it achieves 8× compression compared to FP32.

With only 1 mantissa bit, each power-of-2 interval contains exactly 2 values: X.0 and X.5 (where X is the integer part with the implicit leading 1). For example, between 1 and 2, the only representable values are 1.0 and 1.5.

Like other OCP microscaling formats, FP4 E2M1 does not support infinity or NaN. All 16 bit patterns map to finite numbers. It's always used with a shared block exponent that extends its effective range.

Only 16 values You can memorize the entire format! The 8 non-negative values are: 0, 0.5, 1.0, 1.5, 2.0, 3.0, 4.0, 6.0. Negative versions mirror these. That's all there is.

Encoding Rules

Normal Numbers

value = (-1)sign × 2(exponent - 1) × (1 + mantissa / 2)

With 1 mantissa bit, there are only 2 values per power-of-2 interval: 1.0 and 1.5 (times the power of 2). The bias of 1 is calculated as 2(e-1) - 1, where e is the number of exponent bits (2).

Subnormal Numbers

value = (-1)sign × 20 × (mantissa / 2)

The only subnormal value is 0.5 (mantissa = 1).

Complete Value Table

Here are all 16 values that FP4 E2M1 can represent:

Bit PatternHexValueType
0 00 00x00+Zero
0 00 10x10.5Subnormal
0 01 00x21Normal
0 01 10x31.5Normal
0 10 00x42Normal
0 10 10x53Normal
0 11 00x64Normal
0 11 10x76Normal
1 00 00x8-0-Zero
1 00 10x9-0.5Subnormal
1 01 00xA-1Normal
1 01 10xB-1.5Normal
1 10 00xC-2Normal
1 10 10xD-3Normal
1 11 00xE-4Normal
1 11 10xF-6Normal

Interactive Value Visualizer

Click any bit to flip it, drag the slider, or enter a decimal or hex value. The graphs show how values are distributed across the encoding space.

Dynamic Range & Precision

PropertyValue
Max Positive (Normal)6
Min Positive (Normal)1
Max Subnormal0.5
Min Positive (Subnormal)0.5
Machine Epsilon (at 1.0)0.5
Approx. Decimal Digits~0.3
Exponent Bias1
Exponent Range2^0 to 2^2
Total Bit Patterns16
Supports InfinityNo
Supports NaNNo

All Representable Values

Since there are only 16 possible bit patterns, here is the complete enumeration:

ValueBit PatternDecimal
+00 00 00
-01 00 0-0
Min Subnormal0 00 10.5
Max Subnormal0 00 10.5
Min Normal0 01 01
Max Normal0 11 16

Format Comparison

PropertyFP4 E2M1FP6 E2M3FP6 E3M2FP8 E4M3
Total Bits4668
Sign Bits1111
Exponent Bits2234
Mantissa Bits1323
Bias1137
Max Value67.528448
Min Normal110.250.015625
Epsilon0.50.1250.250.125
~Decimal Digits~0.3~0.9~0.6~0.9
Has InfinityNoNoNoNo
Has NaNNoNoNoYes
Has SubnormalsYesYesYesYes

Where FP4 E2M1 Is Used