PLC Hex to Float Converter

Convert Floating Point to Hex (IEEE 754) and solve Modbus Endianness issues.

by KOEED
e.g., 123.45
⇅
e.g., 42F6E666

Modbus Byte Order (Endianness) Helper

If your PLC reads a strange value, try the formats below. CDAB is the most common for Modbus.

⭐ Modbus Word Swap (CDAB)
00 00 00 00
0.0
Most Common for Modbus
Standard Big Endian (ABCD)
00 00 00 00
0.0
Motorola / Network Order
Little Endian (DCBA)
00 00 00 00
0.0
Intel / PC Native
Byte Swap (BADC)
00 00 00 00
0.0
Rare

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.03F8000000011 1111 1000 ...
123.4542F6E6660100 0010 1111 ...
-10.5C12800001100 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.