IEEE-754 half precision packs a floating-point number into just 16 bits, trading range and precision for compactness. It is the fp16 of machine learning and the half of GPU shaders. This inspector decodes every bit so you can see exactly what a half-float represents.
How it works
The 16 bits split into three fields:
bit 15 bits 14..10 bits 9..0
sign (1) exponent (5) mantissa (10)
The exponent uses a bias of 15. For a normal number (stored exponent 1 to 30) the value is:
value = (-1)^sign x 1.mantissa(binary) x 2^(exponent - 15)
The leading 1. is implicit and not stored. When the stored exponent is all zeros the number is subnormal: the implicit bit becomes 0 and the effective exponent is pinned at -14. An all-ones exponent means infinity (zero mantissa) or NaN (non-zero mantissa).
Notes and examples
The largest finite half is 0x7BFF, which equals 65504. The smallest positive normal is 2^-14, and subnormals reach down to 2^-24. Precision is about 3 to 4 significant decimal digits. Because the mantissa is only 10 bits, encoding a decimal like 0.1 to half and back will not be exact, which the encode direction of this tool makes visible by showing the nearest representable value.