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

FCHexName
10x01
Read Coils
Read 1–2000 contiguous coil status bits.
20x02
Read Discrete Inputs
Read 1–2000 contiguous discrete input bits.
30x03
Read Holding Registers
Read 1–125 contiguous 16-bit holding registers.
40x04
Read Input Registers
Read 1–125 contiguous 16-bit input registers.
50x05
Write Single Coil
Set a single coil to ON (0xFF00) or OFF (0x0000).
60x06
Write Single Register
Write one 16-bit holding register.
70x07
Read Exception Status
Serial only — vendor-specific status byte.
80x08
Diagnostics
Serial only — loopback / counters.
110x0B
Get Comm Event Counter
Serial only.
120x0C
Get Comm Event Log
Serial only.
150x0F
Write Multiple Coils
Write 1–1968 contiguous coil bits.
160x10
Write Multiple Registers
Write 1–123 contiguous holding registers.
170x11
Report Server ID
Vendor-specific identifier.
200x14
Read File Record
Access extended file-style memory.
210x15
Write File Record
Write extended file-style memory.
220x16
Mask Write Register
Apply AND / OR masks to a single register.
230x17
Read/Write Multiple Registers
Atomic read-then-write.
240x18
Read FIFO Queue
Read a FIFO of 16-bit values.
430x2B
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.

CodeName
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