Skip to content
EnergyCalcHQ
IEEE 754 · ABCD · CDAB · BADC · DCBA

Modbus Float Decoder

Paste the two registers your client returned. All four byte orders are decoded at once, and the ones that produce a plausible engineering value are marked.

Two consecutive registers

Decimal or hex — 17268 and 0x4374 both work. Enter them in the order your client returned them.

Only ABCD gives a plausible reading. That is almost certainly your meter's byte order.
OrderFloat32Uint32Int32Bytes
ABCD
Big-endianSchneider, most European meters
415.0001,13,76,72,1921,13,76,72,19243 CF 80 00
CDAB
Word swappedvery common — catches people out
-2.433e-412,14,75,01,007-2,14,74,66,28980 00 43 CF
BADC
Byte swappedSelec, some Indian meters
-3.272e+93,47,72,74,752-81,76,92,544CF 43 00 80
DCBA
Little-endiansome Chinese meters
1.183e-3884,41,66784,41,66700 80 CF 43

For page numbers, keep Headers and footers ticked under More settings in the print dialog.

Why a 32-bit value comes back as nonsense

Modbus registers are 16 bits. A 32-bit float — voltage, current, power, energy — needs two of them, and the standard never said which half goes first. So manufacturers chose differently, and four conventions are in the field:

OrderNameCommon on
ABCDBig-endianSchneider, most European meters
CDABWord swappedVery common, catches people out
BADCByte swappedSelec, some Indian meters
DCBALittle-endianSome Chinese meters

How to read the result

The tool marks an ordering as plausible when the float lands in the band real measurements occupy — roughly 0.001 to 10 million. Line voltage, current, power factor and energy all sit inside it. Anything outside is noise, not a strange reading.

Usually only one ordering survives, and that is your meter's. When two survive, read a value you can verify independently: line voltage should be near 230 V single phase or 415 V three phase, and power factor is always between 0 and 1.

The distinction that saves the most time

A number that is wildly wrong and a number that is slightly wrong have completely different causes:

  • Absurd — an exponent, or millions of volts. Byte or word order. Use this tool.
  • Plausible but off by a round factor, typically 10, 100 or 1000. CT ratio or a scaling factor, not byte order.
  • Plausible and never changes with load. A phantom register — the meter answered for an address it does not actually implement. No byte order will fix it.

People lose days re-swapping bytes on the second and third cases. The swap only ever fixes the first.

Registers in the wrong order

If your client library already applies a swap, the registers you paste here are post-swap and the answer will be doubly reordered. Read the raw response if you can. Most libraries have a mode that returns the two 16-bit words untouched.

Not every 32-bit value is a float

Energy accumulators are usually unsigned 32-bit integers, not floats, because a float loses precision once the kWh count grows. The table shows the integer interpretations alongside, so check those when a float reading looks wrong for a total-energy register.

Why one value needs two registers

A Modbus register is 16 bits. An IEEE 754 single-precision float is 32, so every energy, power and voltage reading of any precision spans two consecutive registers — and the protocol has no way to say which half comes first.

That is the whole problem. The bytes are not ambiguous; your interpretation of them is. A meter reporting 200.0 kW and a meter reporting 2.4 × 10⁻⁴¹ are sending identical bytes, and only the order you assume separates them.

Reading the answer off the number itself

You rarely need the manual. Read a register whose true value you already know and the right order announces itself:

  • A huge or tiny exponent — 10⁻⁴¹, 10³⁸ — means the two words are swapped. Try CDAB.
  • Roughly right but wrong by orders of magnitude— 199,680 where you expected 200 — means the bytes inside each word are swapped. Try BADC.
  • Nonsense in both halves means both are swapped. Try DCBA.

Line voltage is the register to test on. It is always present, it is always near 240 or 415, and no plausible byte order produces a near-miss you could mistake for a real reading.

Not everything is a float

Before assuming a decoding problem, check the data type. Plenty of meters report 32-bit integers with a separate scale factor — energy in watt-hours rather than kilowatt-hours, or current in milliamps — and a register pair holding an integer decoded as a float gives a spectacular wrong answer that looks like a byte order fault.

The tell is the scale. A reading that is out by exactly 1,000 or 10 is a scaling issue, not an ordering one, and no amount of swapping will fix it.

Watch 16-bit energy registers too. They wrap at 65,535, and a counter that resets to zero mid-month will be read as a negative consumption unless your poller handles the rollover.