BFloat16 Converter
Convert decimal numbers to BFloat16 representation or decode a 16-bit BF16 binary pattern back to its floating-point value. Inspect the sign, exponent, fraction and hexadecimal representation.
What Is BFloat16?
BFloat16, commonly abbreviated BF16, is a 16-bit floating-point format designed to preserve much of the numerical range of IEEE 754 single precision while using only half as many storage bits.
A BFloat16 value contains one sign bit, eight exponent bits and seven fraction bits. Its eight-bit exponent field gives BF16 approximately the same exponent range as Float32, while its shorter fraction reduces precision.
BFloat16 Bit Layout
| Field | Bits | Purpose |
|---|---|---|
| Sign | 1 | Positive or negative value |
| Exponent | 8 | Biased exponent |
| Fraction | 7 | Stored significand fraction |
| Total | 16 | Complete BF16 representation |
S | EEEEEEEE | FFFFFFF
1 + 8 + 7 = 16 bits
Decimal to BFloat16 Example
1.5
BFloat16:
0 01111111 1000000
Complete binary:
0011111111000000
Hex:
3FC0
The sign bit is 0, the stored exponent is 127, and the fraction begins with 1 because 1.5 in binary is 1.1 × 2⁰.
BFloat16 Exponent
BFloat16 uses an eight-bit exponent and an exponent bias of 127, the same exponent width and bias used by IEEE 754 Float32.
127
Bias:
127
True exponent:
127 – 127 = 0
BFloat16 Precision
BFloat16 stores seven explicit fraction bits. Normal values also have an implicit leading 1, providing approximately eight bits of significand precision.
Because only seven fraction bits are stored, many decimal values cannot be represented exactly and must be rounded to a nearby BF16 value.
Normal, Subnormal and Special Values
| Exponent | Fraction | Classification |
|---|---|---|
| 00000000 | 0000000 | Zero |
| 00000000 | Nonzero | Subnormal |
| 00000001–11111110 | Any | Normal |
| 11111111 | 0000000 | Infinity |
| 11111111 | Nonzero | NaN |
Why BFloat16 Is Used
BF16 preserves the wide exponent range of Float32 while reducing each value from 32 bits to 16 bits. This can reduce memory usage and data movement when full Float32 precision is not necessary.
The format is particularly associated with modern numerical computing and machine-learning hardware because many workloads can tolerate reduced significand precision while benefiting from the wider exponent range.
BFloat16 Rounding
When a Float32 value is converted to BF16, the lower fraction bits must be discarded. Proper conversion generally rounds the value rather than simply cutting off those bits.
This calculator uses round-to-nearest with ties resolved toward an even retained value, which avoids systematic bias in halfway cases.
Important BFloat16 Notes
BF16 uses 1 sign bit, 8 exponent bits and 7 stored fraction bits.
Its exponent bias is 127.
BF16 has approximately the same exponent range as Float32 but much lower significand precision.
Values may change slightly during conversion because BF16 rounding is required.
An exponent of 11111111 represents infinity when the fraction is zero and NaN when the fraction is nonzero.