%3C/text%3E%3C/svg%3E">
💻
💻 Tech & IT

FP16 / bfloat16 / FP32 Precision Converter

Results update as you type.

Your numbers

Understanding the FP16, bfloat16 and FP32 converter — concept and principle

ML and graphics hardware often store numbers in 16 bits to save memory and bandwidth. The two common 16-bit formats split their bits differently: IEEE half precision (FP16) keeps more fraction bits, while bfloat16 (bf16) keeps the full FP32 exponent range. This converter rounds a decimal number to the nearest FP32, bfloat16 and FP16 value, shows the FP16 bit pattern in hex and lists each format's machine epsilon.

Bit layouts of FP32, bfloat16 and FP16FP32 has 1+8+23 bits and stores 3.141590118; bfloat16 (1+8+7) and FP16 (1+5+10) both store 3.140625.Storing 3.14159 in three formatsFP323.141590118823bfloat163.14062587FP163.140625 · 0x4248510signexponent bitsfraction bits16-bit formats are off by ≈ 0.00097epsilon: FP16 9.77e-4 · bf16 7.81e-3
Fewer fraction bits mean coarser steps: both 16-bit formats round 3.14159 to 3.140625.

How it is calculated

The principle

A floating-point number is scientific notation in base 2: the exponent sets the scale, the fraction sets the precision. With p fraction bits, numbers between 2ᵉ and 2ᵉ⁺¹ are spaced 2^(e − p) apart, so the relative rounding error is at most half the epsilon. FP16 spends more bits on the fraction and has about 3 significant decimal digits but a maximum of 65504. bfloat16 has only about 2–3 digits but reaches about 3.4 × 10³⁸ like FP32, which helps neural-network training avoid overflow.

Worked example

  1. Input: 3.14159. It lies between 2 and 4, so the exponent is 1.
  2. FP32 keeps 23 fraction bits, pattern 0x40490FD0, which is 3.141590118.
  3. bfloat16 keeps the upper half 0x4049; the dropped half 0x0FD0 is below 0x8000, so it rounds down to 2 × (1 + 73/128) = 3.140625.
  4. FP16: fraction = round((3.14159 ÷ 2 − 1) × 1024) = round(584.29) = 584 = 0x248, biased exponent 1 + 15 = 16, giving bits 0 10000 1001001000 = 0x4248.
  5. Its value is 2 × (1 + 584/1024) = 3.140625. Since 584/1024 = 73/128, both 16-bit formats give the same value here.
How FP32 stored value changes with Decimal numberHow FP32 stored value changes with Decim…024680.7851.572.363.143.934.716.28Example: 3.141590118Decimal number
Each point is the calculator re-run with only “Decimal number” changed; the gold point is the default example. Change the inputs above and this chart follows your numbers.
Decimal numberFP32 stored value
0.7850.7853969932
1.571.570790052
2.362.356189966
3.143.141590118
3.933.926990032
4.714.712379932
6.286.283180237

How to read the result

The difference from your input is the rounding error: 3.14159 − 3.140625 ≈ 0.000965, a relative error of about 3 × 10⁻⁴. Near 3, FP16 values are 2⁻⁹ ≈ 0.00195 apart and bf16 values 2⁻⁶ ≈ 0.0156 apart, so other inputs in this range will show larger bf16 errors.

Common mistakes

Keep in mind: The FP16 path rounds halfway cases upward rather than to even, so rare tie cases can differ by one unit in the last place from hardware conversion. Verify critical values with your framework.

Frequently asked questions

What is the largest FP16 number?

65504; the smallest positive normal value is 2⁻¹⁴ ≈ 6.10 × 10⁻⁵.

Why do GPUs offer bfloat16?

It halves memory like FP16 but keeps the FP32 exponent range, so training needs less loss scaling.

Is FP16 the same as half precision?

Yes, it is the IEEE 754 binary16 format.

Sources: IEEE 754-2019, IEEE Standard for Floating-Point Arithmetic · Intel, BFLOAT16 – Hardware Numerics Definition, 2018

Checked 8 Nov 2026. Standard formulas and RFC/IEEE definitions, computed locally in your browser — nothing you type is sent anywhere.

💻 All tech & IT tools →🌍 Calculators by country →