Interactive tool for converting and visualizing floating-point numbers across standard and custom formats. Convert between FP32, FP16, BF16, TF32, FP8, etc. while inspecting binary representations and precision loss.
Live URL: https://sw23.github.io/fp-conv/
- Format presets: FP64, FP32, FP16, BF16, TF32, OCP FP4/FP6/FP8
- Integer formats: INT32, UINT32, INT16, UINT16, INT8, UINT8, INT4, UINT4
- OCP format support: Full support for Open Compute Project microscaling formats
- Custom formats: Define any bit layout (0–15 exponent bits, 0–112 mantissa bits)
- Interactive editing: Toggle individual bits and see decimal/hex updates
- Precision analysis: Calculate absolute and relative error between formats
- Special values: Explore zero, infinity, NaN, subnormals, and boundary cases
- Rounding modes: Implements IEEE 754 rounding modes (ties to even, ties away from zero, toward zero, toward +inf, and toward −inf)
- Fixed-point mode: Set exponent bits to 0 for fractional representations
- Mobile-friendly: Works on screens of all sizes
- WebMCP API: AI agents can perform conversions via WebMCP
The following standard formats are supported, in addition to any custom format you define (up to 15 exponent bits and 112 mantissa bits). Interactive pages have been created to help explain and visualize each standard format:
- IEEE 754: FP64, FP32, FP16
- ML/AI: TF32, BF16
- Integer: INT32, UINT32, INT16, UINT16, INT8, UINT8, INT4, UINT4
- OCP Microscaling: FP8 E4M3, FP8 E5M2, FP6 E2M3, FP6 E3M2, FP4 E2M1
- Custom: Supports a wide range of user-defined formats
The fp-conv-mcp npm package provides
a local Model Context Protocol server, giving
agents direct local access to floating point format conversions.
Example client configuration (VS Code, .vscode/mcp.json):
{
"servers": {
"fp-conv": {
"type": "stdio",
"command": "npx",
"args": ["-y", "fp-conv-mcp"]
}
}
}See the package README for full usage, per-client setup, and debugging instructions.
MIT © 2026 Spencer Williams. See LICENSE.