PortDock

MQTT Payload Decoder (Sparkplug B)

Paste an MQTT message as HEX, Base64 or text to format JSON and decode Sparkplug B metrics (name, alias, type, value) and raw packets (topic, QoS, packet ID).

Examples

No broker connection is made. The bytes you paste are decoded inside this browser and never sent anywhere. A CONNECT password is shown only as its length.

What it decodes

  • JSON — UTF-8 text that starts with { or [ and parses as JSON is shown indented.
  • Sparkplug B — Reads the Eclipse Sparkplug protobuf payload (timestamp, metrics, seq) directly, without a schema file. Each metric's name, alias, time, type (Int16, Float, Boolean …) and value is listed; signed Int8/Int16/Int32 values carried as uint32 are converted by type. When a DATA message carries only an alias and no type, the value is shown from the field it came in.
  • MQTT packets — Paste bytes from Wireshark «Copy as Hex Stream» or a TCP log to see the fixed header (type, flags, remaining length), PUBLISH topic, QoS, RETAIN, DUP and packet ID, MQTT 5 properties, and the payload decoded again by the rules above. CONNECT, CONNACK, SUBSCRIBE, SUBACK, PUBACK, PING and DISCONNECT are split into fields too.
  • Anything else — Text is shown as text, other protobuf as a tree of field numbers, types and values, and the rest as HEX.

Limits

MQTT 3.1.1 and 5.0 PUBLISH packets look alike, but 5.0 adds a properties field, so without a CONNECT in the bytes you may need to pick the version. Compressed Sparkplug payloads (algorithm property), DataSet row values, Template contents and BooleanArray are not decoded in detail. TLS-encrypted bytes (8883) cannot be decoded.

More with the PortDock apps

To see the bytes actually exchanged between a client and the broker, route the 1883 connection through the relay mode of PortDock TCP and paste its HEX log here. Files saved with «Save as pcap» open in Wireshark as well.

FAQ

Do I need the Sparkplug .proto file?

No. This page knows the Sparkplug B 3.0 Payload and Metric field numbers, so the bytes are enough.

Metrics show only an alias, no name

Sparkplug announces names and aliases once in NBIRTH/DBIRTH and may send only aliases in later DATA messages. Decode the node's BIRTH message to match alias numbers to names.

The timestamp shows 1970

Sparkplug times are milliseconds since 1970-01-01 UTC. If the sender puts seconds or 0 there, it looks like this.

References