MQTT Topic Filter Tester
MQTT subscribers use topic filters with two wildcards, + and #, to select which published topics they receive. Small mistakes, such as a misplaced # or forgetting that $SYS topics are skipped by a leading wildcard, silently change what a client sees. Enter a filter, edit the sample topics, and see for every topic whether it matches and exactly which level decides it. Everything runs in your browser; nothing is sent to a broker.
-
| Topic | Result | Level by level | Why |
|---|
- ✓ level matched
- ✗ first mismatch
- · not evaluated / extra
MQTT wildcard rules cheat sheet
Section titled “MQTT wildcard rules cheat sheet”| Rule | Detail | Example |
|---|---|---|
| Levels | Topics and filters are split on /. Levels may be empty (a//b has three levels). |
plant1//x is a valid topic |
+ single level |
Matches exactly one level, including an empty one. Must be a whole level by itself. | a/+/c matches a/b/c, not a/c or a/b/b/c |
# multi level |
Matches the parent level and any number of child levels. Must be the last level and stand alone. | a/# matches a, a/b and a/b/c |
| Invalid filters | a+, a#, a/#/b and the empty filter are rejected. |
sport/tennis# is invalid |
$ topics |
A filter starting with + or # does not match topics beginning with $ (such as $SYS/...). Subscribe with an explicit prefix. |
# misses $SYS/uptime; $SYS/# finds it |
| Publish topics | Topic names used for publishing must not contain + or #, must not be empty and must not contain the null character. |
a/+/b is an invalid topic name |
| Case | Topic matching is case sensitive. | Plant1 is not plant1 |
Broker-specific behaviour such as shared subscriptions ($share/group/filter) and maximum topic length is outside the scope of this tester.