Calculator
Example Data Table
| Decimal | Hex | Binary16 | Class | Meaning |
|---|---|---|---|---|
| 1 | 0x3C00 | 0 01111 0000000000 | Normal | Exact one. |
| -2 | 0xC000 | 1 10000 0000000000 | Normal | Negative power value. |
| 65504 | 0x7BFF | 0 11110 1111111111 | Normal | Largest finite positive value. |
| 0.000000059604644775390625 | 0x0001 | 0 00000 0000000001 | Subnormal | Smallest positive subnormal value. |
| Infinity | 0x7C00 | 0 11111 0000000000 | Infinity | Positive overflow or special input. |
Formula Used
Half precision uses one sign bit, five exponent bits, and ten fraction bits.
Normal number: value = (-1)sign × 2exponent - 15 × (1 + fraction / 1024).
Subnormal number: value = (-1)sign × 2-14 × (fraction / 1024).
Special values: exponent 31 with zero fraction means infinity. Exponent 31 with nonzero fraction means NaN.
How To Use This Calculator
- Enter a decimal number to convert it into half precision.
- Enter a hex or binary16 pattern to decode stored fields.
- Select a rounding mode before submitting.
- Use operand fields to test half precision arithmetic output.
- Press Submit to show results above the form.
- Use CSV or PDF buttons to export the same result set.
Understanding Half Precision
Half precision floating point uses sixteen bits to store a real number. It is also called binary16. The format is small, fast, and useful when memory matters more than wide accuracy. Many graphics, machine learning, and embedded systems use it for compact numeric data.
What This Tool Checks
This calculator converts a decimal value into a sixteen bit pattern. It also decodes a raw hexadecimal or binary pattern back into fields. You can inspect the sign bit, exponent bits, fraction bits, class, unbiased exponent, and approximate decimal value. The arithmetic panel lets you test two operands, then rounds the computed result into half precision.
Why Rounding Matters
Half precision has limited space. Only ten fraction bits are stored. A hidden leading bit is used for normal numbers. Many decimal values cannot be stored exactly. The nearest available pattern is selected by the chosen rounding rule. Nearest even is the common default. Directed modes are helpful when checking upper or lower error bounds.
Limits and Special Cases
The largest finite positive value is 65504. Very small values can become subnormal numbers. Subnormals keep gradual underflow, but they have fewer precise bits. Values beyond range may become infinity. Not a Number patterns represent invalid or undefined results. Signed zero is also supported, so positive zero and negative zero have different bit patterns.
Practical Uses
Use this page when comparing processor output, shader constants, neural network tensors, or packed file formats. It is also useful for teaching. The detailed field view makes each bit position easier to audit. The export buttons help store examples for notes, test cases, and bug reports.
Accuracy Notes
The page uses standard binary16 structure with one sign bit, five exponent bits, and ten fraction bits. Calculations are performed in regular server numeric precision, then rounded to the selected half precision mode. Results should be treated as learning and validation output. Hardware instructions may handle some edge cases with extra flags or platform specific behavior. Always compare with your target environment when building critical numeric software. Keep copies of known inputs and patterns. They make regression checks easier. Small changes in rounding or overflow handling can reveal conversion bugs quickly during reviews and final release testing.
FAQs
1. What is half precision floating point?
It is a 16 bit floating point format. It stores one sign bit, five exponent bits, and ten fraction bits. It is often used where compact storage is important.
2. What is binary16?
Binary16 is another name for half precision floating point. It describes the same 16 bit layout used for small floating point values.
3. What is the largest finite half precision value?
The largest finite positive value is 65504. Larger rounded values may become positive infinity, depending on the selected rounding mode.
4. What is a subnormal value?
A subnormal value is smaller than the normal range. It uses exponent bits of zero and does not include the hidden leading one.
5. Why does my decimal value change?
Many decimals cannot fit exactly in ten fraction bits. The calculator rounds your input to the nearest available half precision pattern or to the chosen directed mode.
6. Can this tool decode hexadecimal patterns?
Yes. Enter a value like 3C00 or 0x3C00. The tool shows the sign, exponent, fraction, class, formula, and decimal value.
7. What does NaN mean?
NaN means not a number. In half precision, it appears when exponent bits are all ones and fraction bits are not zero.
8. Are exported files based on the visible result?
Yes. The CSV and PDF buttons use the same submitted inputs. They export the calculated sections shown after pressing submit.