PLC Hex to Float Converter
Convert Floating Point to Hex (IEEE 754) and solve Modbus Endianness issues.
Modbus Byte Order (Endianness) Helper
If your PLC reads a strange value, try the formats below. CDAB is the most common for Modbus.
What is IEEE 754 Floating Point?
PLCs store real numbers (like temperature 24.5°C) using the IEEE 754 Standard. This format fits a decimal number into 32 bits (2 words) of data. When transmitting this data via Modbus TCP or RTU, the raw binary data is often displayed as a Hexadecimal string (e.g., 0x41C40000).
Solving Modbus "Byte Swap" Issues
The #1 problem in industrial communication is Endianness (Byte Order). Different manufacturers store the 4 bytes of a floating-point number in different orders.
- CDAB (Word Swap): Extremely common in Modbus and Honeywell devices. If your value looks completely wrong (e.g., reading huge numbers instead of 100.0), try this first.
- ABCD (Big Endian): Used by Motorola processors and standard network protocols.
- DCBA (Little Endian): Used by Intel/AMD processors and some PC-based controls.
Conversion Examples
| Float Value | Hex Representation (ABCD) | Binary |
|---|---|---|
| 1.0 | 3F800000 | 0011 1111 1000 ... |
| 123.45 | 42F6E666 | 0100 0010 1111 ... |
| -10.5 | C1280000 | 1100 0001 0010 ... |
Frequently Asked Questions
Why does my Modbus device show "-0.0" or "NaN"?
This usually means the byte order is wrong. Try switching from ABCD to CDAB in the Endianness helper above. If you see "NaN", the hex bytes don't form a valid IEEE 754 float ā check your wiring and register mapping.
How do I verify the hex conversion is correct?
Use a known test value: 1.0 should always convert to 3F800000 in ABCD order. If your PLC shows a different hex value, the byte order or data type configuration may be wrong.
What is the difference between 32-bit float and 16-bit integer?
A 16-bit integer can only represent whole numbers from -32768 to 32767. A 32-bit IEEE 754 float can represent decimals with high precision over a much wider range (±3.4 à 10^38), making it essential for analog measurements like temperature and pressure.