Tool
Modbus Reference & Decoder
Translate between the Modicon-style address (40001…) and the raw register number a Modbus master actually sends, look up function and exception codes, and decode 16- or 32-bit register payloads with selectable word & byte order.
Address translator
Modbus addresses are 0-based on the wire but conventionally written 1-based with a table prefix (0xxxx, 1xxxx, 3xxxx, 4xxxx).
Raw (dec)0
Raw (hex)0x0000
Function codesFC 03 read, FC 06/16 write
Function codes
| FC | Hex | Name |
|---|---|---|
| 1 | 0x01 | Read Coils Read 1–2000 contiguous coil status bits. |
| 2 | 0x02 | Read Discrete Inputs Read 1–2000 contiguous discrete input bits. |
| 3 | 0x03 | Read Holding Registers Read 1–125 contiguous 16-bit holding registers. |
| 4 | 0x04 | Read Input Registers Read 1–125 contiguous 16-bit input registers. |
| 5 | 0x05 | Write Single Coil Set a single coil to ON (0xFF00) or OFF (0x0000). |
| 6 | 0x06 | Write Single Register Write one 16-bit holding register. |
| 7 | 0x07 | Read Exception Status Serial only — vendor-specific status byte. |
| 8 | 0x08 | Diagnostics Serial only — loopback / counters. |
| 11 | 0x0B | Get Comm Event Counter Serial only. |
| 12 | 0x0C | Get Comm Event Log Serial only. |
| 15 | 0x0F | Write Multiple Coils Write 1–1968 contiguous coil bits. |
| 16 | 0x10 | Write Multiple Registers Write 1–123 contiguous holding registers. |
| 17 | 0x11 | Report Server ID Vendor-specific identifier. |
| 20 | 0x14 | Read File Record Access extended file-style memory. |
| 21 | 0x15 | Write File Record Write extended file-style memory. |
| 22 | 0x16 | Mask Write Register Apply AND / OR masks to a single register. |
| 23 | 0x17 | Read/Write Multiple Registers Atomic read-then-write. |
| 24 | 0x18 | Read FIFO Queue Read a FIFO of 16-bit values. |
| 43 | 0x2B | Encapsulated Interface (MEI) Device identification (sub-code 14). |
Exception codes
A server returns the function code OR’d with 0x80 plus one of these exception bytes.
| Code | Name |
|---|---|
| 0x01 | Illegal Function Function code not supported by the server. |
| 0x02 | Illegal Data Address Address (or address+count) is not allowed. |
| 0x03 | Illegal Data Value Value in the request data field is out of range. |
| 0x04 | Server Device Failure Unrecoverable error during request execution. |
| 0x05 | Acknowledge Request accepted, processing will take a long time. |
| 0x06 | Server Device Busy Server is busy processing a long-duration command. |
| 0x08 | Memory Parity Error Server detected a parity error reading memory. |
| 0x0A | Gateway Path Unavailable Gateway couldn't allocate a path to forward the request. |
| 0x0B | Gateway Target No Response No response from the downstream target device. |
Register value decoder
Enter one or two 16-bit register values (decimal, or hex with 0x prefix). Toggle word and byte order to match how your PLC packs 32-bit values.
Word order
Byte order
A as UINT1616968
A as INT1616968
A in hex0x4248
A in binary0100 0010 0100 1000
B as UINT160
B as INT160
Combined UINT321112014848
Combined INT321112014848
Combined hex0x42480000
IEEE-754 float50.000000
Word / byte order cheat sheet
- ABCD (word BE, byte BE) — Modbus standard for 32-bit values.
- CDAB (word LE, byte BE) — common in older Schneider PLCs.
- BADC (word BE, byte LE) — byte-swap within each word.
- DCBA (word LE, byte LE) — full little-endian.
tool