MQTT Topic Tester
Validate MQTT subscription patterns and test topic matching
Use + for single-level wildcard, # for multi-level wildcard
Enter one topic per line to test against the pattern
Quick Examples
Results
Enter a pattern and topics to test
Wildcard Reference
+
Single-Level Wildcard
Matches exactly one topic level at its position.
#
Multi-Level Wildcard
Matches any number of levels. Must be the last character in the pattern.
MQTT Topic Patterns Guide
What is MQTT Topic?
MQTT topics are UTF-8 strings used to filter messages. They are hierarchical, with levels separated by forward slashes (/). Topics are case-sensitive and can include almost any character.
Topic Structure
A typical MQTT topic follows a hierarchical structure like 'building/floor/room/sensor/type'. This allows for flexible subscription patterns using wildcards.
Best Practices
- Use meaningful, descriptive topic names that reflect the data hierarchy
- Avoid leading slashes as they create an empty first level
- Keep topic names reasonably short to reduce bandwidth usage
- Use lowercase letters and hyphens for consistent naming
Frequently Asked Questions
What is the difference between + and # wildcards?
The + wildcard matches exactly one topic level (e.g., 'sensor/+/temp' matches 'sensor/kitchen/temp'), while # matches any number of levels and must be the last character (e.g., 'home/#' matches 'home', 'home/living', 'home/living/light').
Can I use wildcards when publishing messages?
No, wildcards (+ and #) can only be used in subscription topic filters. When publishing a message, you must specify the exact topic name without any wildcards.
Are MQTT topics case-sensitive?
Yes, MQTT topics are case-sensitive. 'Home/Temperature' and 'home/temperature' are treated as completely different topics. Always maintain consistent casing in your topic naming conventions.
Related Tools
MQTT WebSocket Client
Browser-based MQTT client for connecting, publishing, subscribing, and debugging IoT messages via WebSocket
MQTT Codec
Encode and decode MQTT protocol packets with detailed field breakdown, hex viewer, and packet builder
Modbus RTU/ASCII/TCP Parser
Parse, encode, and debug Modbus RTU/ASCII/TCP protocol frames with CRC-16/LRC calculation and serial debugging
JSON Formatter
Format and validate JSON data for improved readability and debugging