MQTT payload decoder

Paste a payload. The format is detected automatically, or pick one with the buttons if the guess is wrong.

Detected format: Base64
Format override
Decoded text
{"temp":21.5,"unit":"C"}
Pretty JSON
{
  "temp": 21.5,
  "unit": "C"
}
Hex dump
00000000  7b 22 74 65 6d 70 22 3a  32 31 2e 35 2c 22 75 6e  {"temp":21.5,"un
00000010  69 74 22 3a 22 43 22 7d                           it":"C"}

24 bytes

How auto-detection works

Formats are tried in order: JSON, hex, Base64, then plain text. Hex is checked before Base64 because its alphabet is narrower. Short input can still be ambiguous, which is what the override is for.

JSON payloads

Valid JSON is pretty-printed with two-space indentation. A number in quotes stays a string here; MQTT Viewer's charts treat it as a number.

Binary payloads

PNG, JPEG, gzip and other binary payloads are recognised by their leading bytes and shown as a hex dump instead of being forced through UTF-8 as garbled text.

Nothing leaves the browser

Decoding is client-side. There is no upload and no network call.

Frequently asked questions

How does the payload decoder pick a format?

It tries JSON first, then hex, then Base64, then falls back to plain text. The format buttons override the guess.

Why is hex checked before Base64?

A hex string only contains 0-9 and a-f, so it is matched precisely. Base64 uses a wider alphabet that overlaps with plain text, so it is checked after hex to avoid false positives.

What is the maximum MQTT payload size?

The protocol allows up to 256 MB in one PUBLISH packet. Brokers set their own lower limit, for example mosquitto's message_size_limit, which defaults to unlimited, and most cloud brokers cap payloads at 64 KB to 256 KB.

Does the decoder upload the payload?

Decoding runs in the browser with no network call. The payload never leaves the page.

MQTT Viewer decodes Sparkplug B, Base64 and Hex inside the live message view. Download MQTT Viewer.

MQTT Viewer is free and open source, and runs on macOS, Windows and Linux.

Download MQTT Viewer