MQTT Topic Matcher & Wildcard Tester
Paste topic filters and topics to see which subscriptions match, with the reason for every mismatch. Or paste a Mosquitto ACL file to see what a client may publish and receive.
Last updated
Topic filters
Subscriptions or ACL patterns, one per line
Topics to test
Topic names, or subscriptions to check against ACLs
Results
4 of 5 matcheddevices/dev-1042/sensors/17/statusMatched by 2- Matches:
devices/+/sensors/+/status— Every level matches (2 levels via +). - Matches:
devices/dev-1042/#— # matches the remaining 3 levels: sensors/17/status. - No match:
$share/ingest/devices/+/telemetry— Level 3: "sensors" ≠ "telemetry".
- Matches:
devices/dev-2210/sensors/03/statusMatched by 1- Matches:
devices/+/sensors/+/status— Every level matches (2 levels via +). - No match:
devices/dev-1042/#— Level 2: "dev-2210" ≠ "dev-1042". - No match:
$share/ingest/devices/+/telemetry— Level 3: "sensors" ≠ "telemetry".
- Matches:
devices/dev-1042/eventsMatched by 1- No match:
devices/+/sensors/+/status— Level 3: "events" ≠ "sensors". - Matches:
devices/dev-1042/#— # matches the remaining 1 level: events. - No match:
$share/ingest/devices/+/telemetry— Level 3: "events" ≠ "telemetry".
- No match:
devices/dev-2210/telemetryMatched by 1- No match:
devices/+/sensors/+/status— Level 3: "telemetry" ≠ "sensors". - No match:
devices/dev-1042/#— Level 2: "dev-2210" ≠ "dev-1042". - Matches:
$share/ingest/devices/+/telemetry— Every level matches (one level via +).
- No match:
Devices/dev-1042/telemetryNo match- No match:
devices/+/sensors/+/status— Level 1: "Devices" ≠ "devices" — topics are case-sensitive. - No match:
devices/dev-1042/#— Level 1: "Devices" ≠ "devices" — topics are case-sensitive. - No match:
$share/ingest/devices/+/telemetry— Level 1: "Devices" ≠ "devices" — topics are case-sensitive.
- No match:
Filter check
devices/+/sensors/+/statusMatches 2 of 5devices/dev-1042/#Matches 2 of 5$share/ingest/devices/+/telemetryMatches 1 of 5Shared subscription in group "ingest" — matching uses devices/+/telemetry.
MQTT topic quick reference
- /
- Separates topic levels. Empty levels are allowed: a//b has three.
- +
- Single-level wildcard: any value for exactly one level, including an empty one.
- #
- Multi-level wildcard: this level and everything below, including the parent. Must be last.
- $SYS/…, $aws/…
- Topics starting with $ aren't matched by filters that start with + or #.
- $share/{group}/{filter}
- MQTT 5 shared subscription: messages are load-balanced across the group.
- %c, %u
- Mosquitto ACL patterns: replaced by the client ID / username when they are a whole level.
- user, topic, pattern
- acl_file lines. Access is read, write, readwrite (default) or deny; deny is checked first.
Keyboard shortcuts:Ctrl ↵Copy resultsCtrl SDownloadCtrl KSearch tools
How to use the MQTT Topic Matcher
Add your filters
Enter subscriptions or ACL patterns under Topic filters, one per line. + and # wildcards, $share/ prefixes and %c / %u are supported.
Add topics to test
Enter the topics your devices publish to. A line with wildcards is treated as a subscription and checked against the filters as permissions.
Read the results
Every topic lists each filter with a ✓ or × and the reason — for example, the first level that differs.
Check filters or an ACL file
Filter check flags invalid and overlapping filters. Switch to Mosquitto ACL file to see what a user may publish and receive.
Features
- Checks topics against many topic filters at once (up to 200 lines in each box)
- Single-level + and multi-level # wildcards, following the MQTT 3.1.1 and 5.0 matching rules
- Explains every result: which level differs, extra or missing levels, and case-only differences
- Validates filters and topic names: misplaced wildcards, wildcards in topic names, null characters and the 65,535-byte limit
- Applies the $ rule: filters starting with + or # don't match $SYS/… or $aws/… topics
- MQTT 5 shared subscriptions ($share/{group}/{filter}) are matched by their inner filter
- Mosquitto-style ACL patterns: %c and %u are replaced with a client ID and username you enter
- Subscription coverage check: is a subscription such as devices/dev-1042/+/status allowed by a permission such as devices/%c/#?
- Overlap check: flags duplicate filters and filters already covered by another, which can deliver the same message twice
- Mosquitto ACL file mode: paste an acl_file, pick a user and client ID, and see publish, receive and subscribe verdicts with the line that decided each one
- Warnings for leading or trailing slashes, empty levels and stray spaces
- Copy or download the results — also with Ctrl/Cmd + Enter and Ctrl/Cmd + S
Privacy
Your topic filters, topics, client ID and username are processed by JavaScript in your browser tab. Nothing is sent to a server, and DevNest never connects to an MQTT broker.
Examples
Route IoT device telemetry
Three consumers subscribe to a device fleet. One firmware build publishes with a capital D — and silently matches nothing.
Filters · topics
devices/+/sensors/+/status devices/dev-1042/# $share/ingest/devices/+/telemetry --- devices/dev-1042/sensors/17/status devices/dev-2210/telemetry Devices/dev-1042/telemetryResult
devices/dev-1042/sensors/17/status matched by: devices/+/sensors/+/status, devices/dev-1042/# devices/dev-2210/telemetry matched by: $share/ingest/devices/+/telemetry Devices/dev-1042/telemetry no matchReserved $aws and $SYS topics
Filters starting with + or # never match $ topics, so an AWS IoT shadow update needs an explicit $aws/… filter.
Filters · topics
# +/shadow/update $aws/things/+/shadow/update --- $aws/things/device-1042/shadow/update $SYS/broker/clients/connected devices/shadow/updateResult
$aws/things/device-1042/shadow/update matched by: $aws/things/+/shadow/update $SYS/broker/clients/connected no match devices/shadow/update matched by: #, +/shadow/updateCheck a Mosquitto ACL file
Client dash-01 logs in as dashboard: it may read all device topics except config, and write only to its own subtree.
acl_file · topics
pattern readwrite devices/%c/# user dashboard topic read devices/# topic deny devices/+/config/# --- devices/dev-1042/telemetry devices/dev-1042/config/wifi devices/dash-01/heartbeat devices/#Result
devices/dev-1042/telemetry publish: denied, receive: allowed devices/dev-1042/config/wifi publish: denied, receive: denied devices/dash-01/heartbeat publish: allowed, receive: allowed devices/# subscribe: allowed (Allowed by line 4: topic read devices/#. Messages matching devices/+/config/# are still blocked by line 5.)
Understanding MQTT topics and wildcards
How MQTT topics work
An MQTT topic is a UTF-8 string split into levels by /. Devices publish messages to a topic name, and clients receive them by subscribing with a topic filter, which may contain wildcards. The broker delivers each message to every subscription whose filter matches the topic.
devices / dev-1042 / sensors / 17 / status
level 1 level 2 level 3 4 level 5Matching is exact and case-sensitive: Devices/dev-1042/telemetry and devices/dev-1042/telemetry are different topics, and a subscription to one never receives messages for the other.
MQTT wildcards: + and #
+ is the single-level wildcard: it matches exactly one level, whatever its value (including an empty level). # is the multi-level wildcard: it matches the level it's on and every level below — and the parent level too.
| Filter | Matches | Doesn't match |
|---|---|---|
| sensors/+/temperature | sensors/kitchen/temperature | sensors/kitchen/air/temperature |
| sensors/# | sensors, sensors/kitchen/temperature | sensor/kitchen |
| +/+ | a/b, /finance | finance |
| # | every topic that doesn't start with $ | $SYS/broker/uptime |
- Both wildcards must take up a whole level:
sensors+andsensors/temp#are invalid. #must be the last level:sensors/#/temperatureis invalid.- Wildcards are only allowed when subscribing. Publishing to a topic containing
+or#is a protocol error.
Topics that start with $
Brokers use topics beginning with $ for their own purposes — for example $SYS/ for broker statistics, or $aws/ for device shadows and jobs in AWS IoT Core. The MQTT specification says a filter starting with a wildcard must not match these topics, so a subscription to # or +/status won't receive them. Subscribe to them explicitly instead, such as $SYS/#.
Shared subscriptions
MQTT 5 adds shared subscriptions of the form $share/{group}/{filter}. Subscribers in the same group share the load: each matching message goes to only one of them. That's how you scale a back-end consumer horizontally without processing every message twice. Matching works on the filter after the group name, so $share/ingest/devices/+/telemetry matches exactly what devices/+/telemetry matches.
ACL patterns and subscription coverage
Brokers restrict which topics each client may use with access control lists (ACLs). In Mosquitto, a pattern line can include %c (the client ID) and %u (the username), so one rule gives every device its own subtree:
# mosquitto acl_file
pattern readwrite devices/%c/#
# Client dev-1042 may use: devices/dev-1042/telemetry
# …but not another device's: devices/dev-2210/telemetryEnter a client ID and username in the tool to expand these. To check a subscription rather than a topic, put it in the Topics box: it's allowed only if every topic it could receive is also matched by the permission. devices/dev-1042/+/status is inside devices/dev-1042/#, but devices/+/status is not.
Brokers differ in how they check subscriptions against their rules. AWS IoT Core policies, for example, use their own * and ? policy wildcards in topicfilter resources rather than MQTT wildcards. Treat this tool as a check of MQTT filter logic, and confirm the final policy against your broker's documentation.
Overlapping subscriptions
Subscriptions overlap when one filter already matches everything another does — for example devices/# and devices/+/telemetry. If one client holds both, the MQTT specification allows the broker to send a separate copy of a message for each matching subscription, so the client can process the same reading twice. Filter check marks these with an Overlaps badge, along with exact duplicates.
Checking a Mosquitto acl_file
Switch the tool to Mosquitto ACL file, paste your file and enter the client ID and username to check. The tool follows the rules from the Mosquitto documentation:
topiclines apply only to theusersection they appear in. Lines before the firstuserline apply to anonymous clients.patternlines apply to every client, with%cand%ureplaced by its client ID and username.- Access is
read,write,readwrite(the default) ordeny. Deny rules are checked before rules that grant access. - Anything no rule grants is denied.
pattern readwrite devices/%c/#
user dashboard
topic read devices/#
topic deny devices/+/config/#Each topic shows whether the client may publish to it and receive it, with the line that decided. A line with wildcards is checked as a subscription. Even when a subscription is allowed, Mosquitto checks read access again for every message it delivers, so the tool warns when a deny rule still blocks part of it.
Topic design tips from real IoT fleets
- Put the device ID near the start (
devices/{deviceId}/…) so a single rule such asdevices/%c/#scopes each device to its own topics. - Don't start topics with
/. It adds an empty first level, and/devices/…silently stops matchingdevices/#. - Keep topics lowercase and consistent. One firmware build that publishes
Devices/…drops out of every subscription without any error. - Split high-volume telemetry from events and commands (
…/telemetry,…/events,…/cmd) so each consumer subscribes only to what it needs. - Avoid subscribing to
#in production services — use the narrowest filter that works, and a shared subscription to scale. - Keep secrets and personal data out of topic names: topics appear in broker logs, ACL files and monitoring tools.
Frequently asked questions
What is the difference between + and # in MQTT?
+ matches exactly one topic level, so sensors/+/temperature matches sensors/kitchen/temperature but not sensors/kitchen/air/temperature. # matches any number of levels, including none, and must be the last level of the filter.
Does sensors/# match the topic sensors?
Yes. The multi-level wildcard also matches the parent level, so sensors/# matches sensors as well as sensors/kitchen and sensors/kitchen/temperature. It doesn't match topics that only begin with the same letters, such as sensorsX.
Why doesn't my # subscription receive $SYS or $aws messages?
The MQTT specification says a filter whose first level is a wildcard must not match topics starting with $. Subscribe to those topics explicitly, for example $SYS/# or $aws/things/my-device/shadow/#.
Are MQTT topics case-sensitive?
Yes. Topics are compared character by character, so Devices/dev-1042 and devices/dev-1042 are different topics. The matcher points out mismatches that differ only in case.
Can I publish to a topic with a wildcard?
No. Wildcards are only allowed in subscriptions. A topic name used for publishing must not contain + or #, and brokers reject or disconnect clients that try.
Does a leading slash change the topic?
Yes. /devices/dev-1042 has an empty first level, so it has three levels and doesn't match devices/#. The tool warns about leading and trailing slashes for this reason.
Why does Mosquitto reject my publish or subscribe?
With an acl_file, Mosquitto denies everything no rule grants. Topic lines only apply to the user section they're in — lines before the first user line apply to anonymous clients — while pattern lines apply to every client, and deny rules are checked first. Paste the file into the ACL file mode to see which line decides each topic.
Can overlapping subscriptions deliver duplicate messages?
Yes. If one client's subscriptions overlap, such as sensors/# and sensors/+/temperature, the MQTT specification allows the broker to send a separate copy for each matching subscription. Filter check flags filters that are already covered by another one.
Does this tool connect to my MQTT broker?
No. It applies the MQTT matching rules in your browser without opening any network connection, so you can test production topic names and ACL patterns safely.