Skip to main content

Overview

MQTT Explorer provides a powerful publishing interface that makes it easy to send messages to any topic. Whether you’re testing IoT devices, triggering automations, or sending configuration updates, the Publish tab gives you complete control over your MQTT messages.

Publish Tab Interface

Access the Publish tab from the sidebar to send messages: Key Components
  • Topic input: Specify the destination topic path
  • Payload editor: Enter your message payload
  • Editor mode selector: Choose payload format
  • Retain switch: Control message retention
  • QoS selector: Set Quality of Service level
  • Publish button: Send the message
  • Publish history: Access recently sent messages
You must be connected to an MQTT broker before you can publish messages.

Topic Input

Specify where your message should be published: Topic Entry
  • Type or paste the full topic path (e.g., home/livingroom/light/command)
  • Auto-complete based on existing topics (when available)
  • Copy topic path from selected topics in the tree
  • Topic validation ensures valid MQTT topic syntax
Quick Topic Selection
  • Click any topic in the tree view
  • The topic path is automatically copied to the publish topic field
  • Edit the path as needed before publishing
Use the forward slash (/) separator to create topic hierarchies. Avoid using wildcards (# or +) in publish topics.

Payload Editor

The integrated code editor provides a comfortable writing experience:

Editor Features

Syntax Highlighting

Color-coded syntax for JSON, XML, and other formats

Line Numbers

Easy reference for long payloads

Auto-Indentation

Automatic indentation for structured data

Multi-line Support

Full editor for complex payloads

Keyboard Shortcuts

ShortcutAction
Ctrl/Cmd + EnterPublish the message
TabInsert indentation
Shift + TabRemove indentation
The editor automatically adjusts to light or dark mode based on your system theme.

Editor Modes

Choose the appropriate format for your message payload:
Best for: Structured data, configuration objects, device statesFeatures:
  • JSON syntax highlighting
  • Format validation
  • Format JSON button to pretty-print
  • Auto-complete for braces and quotes
Example:
{
  "state": "ON",
  "brightness": 75,
  "color": {
    "r": 255,
    "g": 128,
    "b": 0
  }
}
Best for: Simple values, commands, plain text messagesFeatures:
  • No formatting constraints
  • Line breaks preserved
  • Fastest input method
Example:
ACTIVATE
Best for: Binary data, encoded files, encrypted contentFeatures:
  • Base64 encoding/decoding
  • Binary data support
  • Large payload handling
Example:
SGVsbG8gV29ybGQh
Best for: Low-level protocols, raw bytes, hardware communicationFeatures:
  • Hexadecimal encoding
  • Byte-level control
  • Raw binary representation
Example:
48656c6c6f

Format JSON Feature

When working in JSON mode, use the Format JSON button to:
1

Write JSON

Enter your JSON payload (formatted or unformatted)
2

Click Format

Click the Format JSON button (align icon)
3

Get Pretty-Printed Output

Your JSON is automatically formatted with proper indentation and spacing
Error Handling
  • Invalid JSON shows an error message
  • Syntax errors are highlighted
  • Error message indicates what went wrong
Paste minified JSON from any source and click Format JSON to make it readable instantly.

Load from File

Publish file contents as MQTT messages:
1

Click Attach File Button

Click the paper clip icon in the editor toolbar
2

Select File

Choose a file from your system (up to 16MB)
3

File Loaded

File contents are loaded into the payload editor
4

Edit & Publish

Modify if needed, then click Publish
Supported File Types
  • Text files (.txt, .log, .csv)
  • JSON files (.json)
  • XML files (.xml)
  • Configuration files (.yaml, .conf, .ini)
  • Any text-based format
Binary files are encoded as base64. For browser mode, files are uploaded to the server and may be limited by server configuration.

Retain Flag

Control message retention on the broker: Retain Off (Default)
  • Message is delivered to current subscribers
  • Message is not stored by the broker
  • New subscribers won’t receive this message
Retain On
  • Message is stored by the broker
  • New subscribers immediately receive the retained message
  • Overwrites any previous retained message on the topic
  • Useful for state values and configuration
Use retained messages for:
  • Device state values (“light is ON”)
  • Configuration settings
  • Status updates (“device online”)
  • Last known values
Don’t use retained messages for:
  • Temporary commands
  • Event notifications
  • Time-sensitive data
  • Rapidly changing values
To clear a retained message, publish an empty payload with the retain flag enabled to the same topic.

Quality of Service (QoS)

Control message delivery guarantees:

QoS Levels

QoS 0

At most onceFire and forget. No confirmation. Fastest but least reliable.Use for: High-frequency sensor data, non-critical updates

QoS 1

At least onceConfirmed delivery. May receive duplicates.Use for: Important messages, commands, state changes

QoS 2

Exactly onceGuaranteed delivery without duplicates. Slowest but most reliable.Use for: Critical commands, billing data, irreversible actions
The actual QoS level is the minimum of the publisher’s and subscriber’s requested QoS.

Publishing the Message

Send your message to the broker: Publish Methods
  1. Click the Publish button
  2. Press Ctrl/Cmd + Enter while in the editor
Success Feedback
  • Message is added to publish history
  • No error dialog means successful publish
  • Check topic in tree to verify message received (if subscribed)
Error Handling
  • Connection errors show an alert
  • Invalid topic format shows validation error
  • Broker rejection displays error message

Publish History

Quickly resend or reference previous messages: History Features
  • Stores last 8 published messages per session
  • Shows topic, payload preview, and timestamp
  • Click any entry to load it into the editor
  • Automatic duplicate removal
  • Most recent messages first
1

View History

Scroll down below the editor to see publish history
2

Select Message

Click any historical message card
3

Message Loaded

Topic and payload are loaded into the publish form
4

Modify & Resend

Edit as needed and publish again
Use publish history to quickly test variations of a message by loading and modifying previous publishes.

Common Use Cases

Control IoT Devices

Send commands to smart home devices, lights, thermostats, and sensors

Test Integrations

Verify that your applications correctly handle MQTT messages

Trigger Automations

Send messages to activate automation rules in Home Assistant, Node-RED, etc.

Update Configuration

Push configuration updates to devices via retained messages

Send Commands

Execute device commands like “restart”, “update”, or “reset”

Simulate Sensors

Generate test data for development and debugging

Best Practices

Be cautious when publishing to production systems. Always verify the topic path before clicking Publish.
Publishing Tips
  • Use descriptive, hierarchical topic names
  • Include a /cmd or /set suffix for command topics
  • Test with QoS 0 first, then increase if needed
  • Use retained messages sparingly (only for state/config)
  • Validate JSON payloads before publishing
  • Keep payload sizes reasonable (under 1KB when possible)
Security Considerations
  • Only publish to topics you have write permission for
  • Don’t publish sensitive data without encryption
  • Use authentication and TLS for production brokers
  • Be aware that published messages may be logged

Build docs developers (and LLMs) love