How to use the FP16 Converter tool
- Pick Number under Input format to encode a value, or Hexadecimal or binary bits to decode an existing half float.
- Type the input in Number or bit pattern: a decimal such as 0.1, up to four hex digits such as 3C00, or binary after 0b.
- Select Inspect bits. Example runs the tool on -13.25.
- Check the Value line for the number actually stored, then read Hex, Bits, Sign, Exponent, Fraction and Class.
- Select Copy to copy all seven lines.
The IEEE 754 binary16 layout
Half precision uses 16 bits: 1 sign bit, 5 exponent bits with a bias of 15, and 10 fraction bits. IEEE 754 added it as the binary16 interchange format in the 2008 revision. With the implicit leading 1, the significand has 11 bits, which is a little over 3 decimal digits.
- Largest finite value: 65504, pattern 0x7BFF.
- Smallest positive normal value: 2^-14, about 0.000061, pattern 0x0400.
- Smallest positive subnormal: 2^-24, about 5.96e-8, pattern 0x0001.
- Integers are exact up to 2048. 2049 rounds to 2048.
- Infinity is 0x7C00, and any larger pattern below 0x8000 is a NaN.
Worked example: -13.25 as FP16
-13.25 is -1.65625 x 2^3. Add the bias to the exponent: 3 + 15 = 18, or 10010. The fraction 0.65625 is 10101 in binary, padded to ten bits as 1010100000. With the sign bit in front, the word is 1 10010 1010100000. Regrouped into hex digits that is CAA0, and the value is exact.
Value: -13.25
Hex: 0xCAA0
Bits: 1100101010100000
Sign: 1
Exponent: 10010
Fraction: 1010100000
Class: normalRounding, overflow and underflow in Number mode
The tool rounds to the nearest representable half float and breaks ties toward the even fraction, the IEEE 754 default. 0.1 becomes 0x2E66, which is 0.0999755859375. 0.333333 becomes 0x3555, or 0.333251953125.
Overflow follows the standard as well. 65519 still rounds down to 65504, but 65520 is the halfway point to the next power of two and becomes Infinity. At the other end, 3e-8 rounds up to the smallest subnormal 0x0001, and 2.98e-8 rounds to zero. NaN is encoded as 0x7FFF.
Where half precision floats are used
FP16 halves the memory of float32 where three digits are enough. Graphics APIs use it for HDR textures and vertex data, and OpenEXR stores image channels as half floats. Deep learning frameworks use it for mixed-precision training and inference. You also meet it as numpy.float16, _Float16 in C23, Float16Array in JavaScript, and in CBOR, which can encode a float in 16 bits.
Frequently asked questions
What is the maximum value of FP16?
65504, stored as 0x7BFF. It equals (2 - 2^-10) x 2^15. Anything from 65520 upward converts to Infinity in this tool, which matches IEEE 754 round-to-nearest behavior.
Is FP16 the same as bfloat16?
No. Both are 16 bits wide, but IEEE half precision splits them 1-5-10 and bfloat16 splits them 1-8-7. FP16 is more precise and overflows above 65504. Bfloat16 reaches about 3.39e38 with fewer digits. Use the BFloat16 Converter for that format.
How is 1.0 stored in half precision?
As 0x3C00. The sign bit is 0, the exponent field is 01111, which is 15 and cancels the bias, and the fraction is all zeros. The next value up is 0x3C01, which is 1.0009765625.
Why can't I paste a float32 pattern such as 3F800000?
Bit mode accepts at most four hex digits or sixteen binary digits, the width of one half float. Longer input returns Enter up to 4 hexadecimal digits or a binary number prefixed with 0b. Enter the decimal value in Number mode to re-encode it.
What do 0x7C00 and 0x7E00 mean?
0x7C00 has an all-ones exponent and a zero fraction, so it is positive Infinity, and 0xFC00 is negative Infinity. 0x7E00 has a nonzero fraction and is a NaN. The Class line labels each case.