PLC byte decoder (hex → INT, REAL…)
Paste the bytes as you see them in a watch table, Wireshark or a Modbus poll, in any format. You see the same data read as every type and in all four byte orders; further down you can do the reverse, from value to bytes.
The same bytes in the 4 orders
| Type | ABCDbig-endian · Siemens | DCBAlittle-endian · PC/Intel | BADCbyte swap | CDABword swap |
|---|---|---|---|---|
| INT | 17096 | -14270 | -14270 | 17096 |
| UINT | 17096 | 51266 | 51266 | 17096 |
| DINT | 1120403456 | 51266 | -935198720 | 17096 |
| UDINT | 1120403456 | 51266 | 3359768576 | 17096 |
| REAL | 100.0 | 7.1839E-41 | -198656.0 | 2.3957E-41 |
If the right value is in another column, the device uses that order: click the column to pick it.
The value as every type (ABCD order)
| REAL | 100.0 |
|---|---|
| DINT | 1120403456 |
The other way: from value to bytes
Examples: 100.0 · -1 · 16#FFFF · T#1h30m · 2m30s · 12:38:00 · 2026-11-19 12:38:00
| ABCD | 42 C8 00 00 |
|---|---|
| CDAB | 00 00 42 C8 |
Indicative results: always verify with a qualified technician and the applicable standards. Legal notice
The four orders with one example
The same REAL 100.0 (16#42C80000) can arrive in four ways. ABCD big-endian: 42 C8 00 00 (Siemens S7, Profinet, Modbus “high word first”). DCBA little-endian: 00 00 C8 42 (PCs, Rockwell, Beckhoff, Codesys on x86/ARM). BADC byte swap: C8 42 00 00. CDAB word swap: 00 00 42 C8 (many energy meters and drives, Modbus “low word first”).
How to recognise the right order
Look at the four-order table: the right one almost always gives a plausible number, such as a temperature of 21.5 rather than 3.1E-39 or −198656.0. If you know a reference value (a 230 V voltage, a setpoint), type it in the “value to bytes” box and compare the bytes with what you receive.
Formats you can paste
Hex bytes separated by spaces, commas, dashes or colons (42 C8 00 00, 42-C8-00-00), a single string (16#42C80000, 0x42C80000, DW#16#42C80000), C or Python arrays (0x42, 0xC8, 0x00, 0x00), decimal bytes (66, 200, 0, 0) or 16-bit Modbus registers (17096 0). In “Automatic” mode 3-digit numbers are read as decimal, everything else as hex.
Text and STRING
Characters are single bytes and do not change with the order: the “Text” row shows them as they are. If the first two bytes look like maximum and actual length, the tool also shows the Siemens STRING (2 header bytes + characters).
Frequently asked questions
What does word swap (CDAB) mean?
A 32-bit value travels in two 16-bit registers. With word swap the low-word register comes first: 100.0 REAL (16#42C80000) arrives as 00 00 42 C8 instead of 42 C8 00 00.
What number is 42 C8 00 00?
Read as a big-endian REAL it is 100.0; as a DINT it is 1120403456; as two INTs it is 17096 and 0.
Why does my Modbus float read 2.3957E-41?
Almost always the two registers are swapped: 00 00 42 C8 read as ABCD gives 2.3957E-41, read as CDAB it gives 100.0. Pick the CDAB (word swap) order in the Modbus master.
Is Siemens big-endian or little-endian?
Siemens S7 is big-endian: the most significant byte is at the lowest address, like Modbus registers. Rockwell, Beckhoff, Codesys on x86/ARM and PCs are little-endian. In TIA Portal the SWAP instruction reverses the byte order.