MANUFACTURING / INTEGRATION / AUTOMATION
LIVE TOOL

PLC data converter

Registers to values and back for INT16 to INT64, FLOAT32, FLOAT64, BCD and strings in every byte and word order (ABCD, CDAB, BADC, DCBA), with bit fields, the IEEE 754 breakdown and a batch mode. It only converts numbers you type or paste; it does not connect to any device.

Convert
Input and display (all parts)

No device connection. The tool only converts numbers you type or paste (for example from a Modbus poll tool or a PLC watch table); it never reads or writes a device. Registers are 16-bit words; bytes A, B, C … are the value's bytes from the most significant one, and the order lists them as they arrive.

Registers

Decimal (16840, −1), hex (0x41C8, 41C8h, 16#41C8) or binary (0b…); a longer hex number is split into registers as written (0x41C80000). An address before “:” or “=” is skipped (40001: 16840). More registers than one value needs give several values.

Try

Runs in this browser. Data is not uploaded or stored.

Value in every order

25Value in the chosen order
2Registers
1Values

2 registers as FLOAT32, order ABCD (Big-endian: high word first, high byte first): 25. Every other order is in the table.

    The tool does not pick an order for you: compare with one value you know (a setpoint, a temperature on the display). Notes only mark values that are seldom real readings: NaN, infinity, subnormal, negative zero, |x| ≥ 1e9 or below 1e-6, invalid BCD digits.

    FLOAT32 from 0x41C8 0x0000 in every byte and word order
    OrderMeaningBytes A … D (value order)ValueExact valueNotes
    ABCD (chosen)big-endian41 C8 00 002525
    CDABword swap00 00 41 C82.3598e-412.35978661392299194743…e-41subnormal (denormal)
    BADCbyte swapC8 41 00 00-197632-197632
    DCBAlittle-endian00 00 C8 417.1838e-417.18375657736117471409…e-41subnormal (denormal)

    Value

    Numbers with a decimal point or comma, an exponent (1.5e-3), NaN or Infinity. Integers must fit the type. A bit pattern can be typed as 0x… or 0b… (0x41C80000 for FLOAT32, 0xFFFF for INT16 = −1). Text uses the encoding above; it is padded to the register count with NUL bytes or spaces.

    Runs in this browser. Data is not uploaded or stored.

    Registers in every order

    0x3DCC 0xCCCDRegisters in the chosen order
    15820 52429Registers (decimal)
    0.1Stored value

    0.1 as FLOAT32 in order ABCD (Big-endian: high word first, high byte first): 0x3DCC 0xCCCD. Stored as 0.1, not exactly the typed value.

      FLOAT32 registers in every byte and word order
      OrderMeaningHexDecimal (unsigned)Decimal (signed)Binary
      ABCD (chosen)big-endian0x3DCC 0xCCCD15820 5242915820 -131070011 1101 1100 1100 | 1100 1100 1100 1101
      CDABword swap0xCCCD 0x3DCC52429 15820-13107 158201100 1100 1100 1101 | 0011 1101 1100 1100
      BADCbyte swap0xCC3D 0xCDCC52285 52684-13251 -128521100 1100 0011 1101 | 1100 1101 1100 1100
      DCBAlittle-endian0xCDCC 0xCC3D52684 52285-12852 -132511100 1101 1100 1100 | 1100 1100 0011 1101
      Rounding to the nearest float
      QuantityValue
      Typed value0.1
      Stored value (shortest decimal that reads back)0.1
      Exact stored value0.100000001490116119384765625
      Rounding error (stored − typed)1.490116119384765625e-9
      Bit pattern0x3DCCCCCD
      Classnormal

      Bits

      One field per line, columns separated by “;” or tabs (from Excel). Bit 0 is the least significant bit of the value. Types: flag (1 bit), unsigned, signed (two’s complement), enum with names as 0=Off, 1=Manual. Length defaults to 1 bit. A first line with names (Name;Start…) is skipped.

      Runs in this browser. Data is not uploaded or stored.

      Bits of the value

      0x00FB9623Value (hex)
      16487971Unsigned
      16487971Signed
      14 of 32Bits set

      32 bits from 0x00FB 0x9623 in order ABCD: bit 31 is the most significant, bit 0 the least. Register bits are written address.bit.

        Tick a bit to set it (the registers follow). Under each bit number: register.bit
        Registers (order ABCD)
        RegisterHexDecimalSignedBinaryValue bits held
        400010x00FB2512510000 0000 1111 101131–16
        400020x962338435-271011001 0110 0010 001115–0
        Bit fields
        FieldBitsTypeRaw (binary)Value
        Ready0flag1on (1)
        Running1flag1on (1)
        Fault3flag0off (0)
        Mode6–4enum010Auto (2)
        Speed step15–8unsigned10010110150
        Temperature offset23–16signed11111011-5
        Warning code31–24unsigned000000000
        The same bits as FLOAT32 (IEEE 754): (−1)^sign × significand × 2^exponent
        PartValue
        Sign (bit 31)0 (positive)
        Exponent field (bits 30–23)00000001 = 1
        Exponent1 − 127 = -126
        Fraction field (bits 22–0)0x7B9623
        Significand1 + fraction / 2^23 = 1.96551930904388427734375
        Classnormal
        Value (shortest)2.3104568e-38
        Exact value0.00000000000000000000000000000000000002310456844213211844569539658112622176498115177006367762577316090979464256738307170735424733720719814300537109375

        Register sets

        CSV, TSV or TXT up to 20 MB, opened or dropped on the field; read in this browser only. Excel: copy the cells and paste them.

        Cells are split at tabs, “;” or “,” (else at spaces). A first line without registers is a header. Use “Always the first column” when the label is a number (a row number, a time in seconds). A line with several values’ worth of registers gives several values.

        Runs in this browser. Data is not uploaded or stored.

        Batch results

        7Lines
        7Values
        0Lines with errors
        -20.6Smallest
        49.6Largest

        7 lines as FLOAT32 in order CDAB (word swap); header “Tag · Register 1 · Register 2” skipped; 1 line has a note (NaN, infinity, very large …).

          FLOAT32 in order CDAB
          LineLabelRegistersValueNotes
          2TT-101 (°C)0x0000 0x41C825
          3TT-102 (°C)0x3333 0x41CB25.4
          4PT-201 (bar)0x0000 0x40804
          5FT-301 (m³/h)0x6666 0x424649.6
          6LT-401 (%)0x0000 0x7FC0NaNNaN (quiet, payload 0x0)
          7AT-501 (pH)0xD70A 0x40E37.12
          8TT-103 (°C)0xCCCD 0xC1A4-20.6

          Download offline versionSingle HTML file · v1.4 · 306 KB · works without internet

          How the registers are converted

          PLCs and field devices exchange numbers as 16-bit registers. A 32-bit or 64-bit value, a float or a text spans several registers, and devices disagree on the order of the words and of the bytes inside them. The converter shows every order side by side, so the right one can be recognised from a value you know. It does not connect to any device.

          Byte and word orders

          Data types

          Exact floats

          Bits and bit fields

          Worked examples (the tool’s examples)

          1. Registers 0x41C8 0x0000 as FLOAT32, ABCD: bits 0 10000011 10010000…0, so sign +, exponent 131 − 127 = 4, significand 1.5625, value 1.5625 × 2⁴ = 25. In CDAB the same registers are 0x000041C8, the subnormal 2.3598e-41; a device that sends 0x0000 0x41C8 uses CDAB.
          2. INT32 −123456 is 2³² − 123456 = 4294843840 = 0xFFFE1DC0: registers 65534 7616 in ABCD, 7616 65534 in CDAB.
          3. 0.1 as FLOAT32 is 0x3DCCCCCD (registers 0x3DCC 0xCCCD in ABCD), exactly 0.100000001490116119384765625: the rounding error is +1.490116119384765625e-9. As FLOAT64 it is 0x3FB999999999999A, exactly 0.1000000000000000055511151231257827021181583404541015625.
          4. BCD16 0x1234 = 1234 (read with swapped bytes, BA, it is 3412); 0x12F4 is not BCD: digit 3 is F.
          5. STRING “FactoKit” in Latin-1: F = 0x46, a = 0x61 …, so the registers are 0x4661 0x6374 0x6F4B 0x6974 in order AB.
          6. The status word 0x00FB 0x9623 (ABCD, an illustrative example): bits 0 and 1 set (Ready, Running), bit 3 clear (no Fault), bits 4–6 = 010 = 2 (Mode Auto), bits 8–15 = 0x96 = 150 (Speed step), bits 16–23 = 0xFB = −5 as a signed 8-bit field (Temperature offset).
          7. The batch example decodes seven FLOAT32 tags sent low word first (CDAB): TT-101 25, TT-102 25.4 (stored 25.3999996185302734375), LT-401 NaN with a note, TT-103 −20.6.

          Common mistakes

          Input and files

          Questions

          Why do I get 2.3598e-41 instead of 25 from my two registers?
          The registers are read in the wrong word order. 25.0 as a FLOAT32 is 0x41C80000: a device that sends the high word first gives 0x41C8 0x0000 (ABCD), one that sends the low word first gives 0x0000 0x41C8 (CDAB). Read in the other order the same registers become a tiny subnormal number or a large one. The table shows every order at once; pick the one that gives a value you know.
          Which byte order does Modbus use?
          The Modbus protocol sends each 16-bit register with its high byte first (big-endian). It does not say how a 32-bit or 64-bit value is split over several registers, so devices differ: high word first (ABCD) and low word first (CDAB) are the most common, byte-swapped orders occur too. The device manual should say; otherwise compare with a known value.
          Why is 0.1 stored as 0.100000001490116…?
          A FLOAT32 has 24 significant bits, and 0.1 has no finite binary expansion, so the nearest FLOAT32 is stored: 0x3DCCCCCD, exactly 0.100000001490116119384765625. The tool shows the exact stored value and the rounding error. A FLOAT64 is closer (0.1000000000000000055511151231257827…) but still not exact.
          What does a NaN or an infinity in a register mean?
          They are valid IEEE 754 bit patterns: all exponent bits set. Devices use NaN for a missing or failed measurement, and a wrong word order can produce one by accident. The tool marks NaN (quiet or signalling, with its payload), infinity, subnormal numbers and very large or very small values as notes; it never decides which order is right.
          Does the converter connect to my PLC?
          No. It only converts the numbers you type or paste, for example from a Modbus poll tool, a PLC watch table or a log file. Nothing is sent anywhere and no device is read or written; the offline file works without a network.