Skip to content
Esc
  • MQTT Topic MatcherTest MQTT topic filters with + and # wildcards against topics, and check ACL patterns.
  • JSON FormatterBeautify, minify and validate JSON instantly as you type.
  • JSON DiffCompare two JSON documents and see every added, removed and changed value by path.
  • JSON to TypeScriptGenerate TypeScript interfaces or Zod schemas from a sample JSON response.
  • Base64 Encoder/DecoderConvert text to Base64 and back, with full Unicode support.
  • UUID GeneratorGenerate random v4 UUIDs — one or many — in the format you need.
  • JWT DecoderDecode JSON Web Tokens to inspect the header, payload and expiry.
  • Timestamp ConverterConvert Unix timestamps to dates and dates to timestamps.
  • URL Encoder/DecoderPercent-encode and decode URLs, and break down query strings.
  • Hash GeneratorGenerate MD5, SHA-1, SHA-256 and SHA-512 hashes of text or files.
  • Regex TesterTest regular expressions with live match highlighting and groups.
  • YAML to JSON ConverterConvert YAML to JSON and JSON to YAML, with clear error locations.
  • SQL FormatterBeautify or minify SQL for PostgreSQL, MySQL, SQL Server and 9 more dialects.
  • Mock Data GeneratorGenerate realistic fake data for API mocks as JSON, CSV or SQL inserts.
  • HTTP Header AnalyzerGrade response headers: CSP, HSTS, cookies, CORS and caching, explained.
  • Webhook Signature VerifierVerify and generate webhook signatures for GitHub, Stripe, Slack, Shopify and more.
  • Cron Expression GeneratorBuild and explain cron schedules, with the next run times in any time zone.
  • .env File ValidatorFind syntax errors, duplicates and missing keys in .env files.
  • HTML to JSX ConverterConvert HTML to valid React JSX: className, style objects, self-closing tags.
  • SVG to React ComponentTurn SVG files into React icon components with props and currentColor.
  • Markdown EditorWrite Markdown with a live preview, GitHub tables and task lists, and HTML export.

↑ ↓ to moveEnter to openPaste data to open it in the right tool. Nothing leaves your browser.

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

ACL variables

Results

4 of 5 matched
  • devices/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".
  • 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".
  • 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".
  • 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 +).
  • 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.

Filter check

  • devices/+/sensors/+/statusMatches 2 of 5
  • devices/dev-1042/#Matches 2 of 5
  • $share/ingest/devices/+/telemetryMatches 1 of 5

    Shared 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.

How to use the MQTT Topic Matcher

  1. Add your filters

    Enter subscriptions or ACL patterns under Topic filters, one per line. + and # wildcards, $share/ prefixes and %c / %u are supported.

  2. 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.

  3. Read the results

    Every topic lists each filter with a ✓ or × and the reason — for example, the first level that differs.

  4. 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.

Read the DevNest privacy policy

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/telemetry

    Result

    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 match
  • Reserved $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/update

    Result

    $aws/things/device-1042/shadow/update
      matched by: $aws/things/+/shadow/update
    $SYS/broker/clients/connected
      no match
    devices/shadow/update
      matched by: #, +/shadow/update
  • Check 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 5

Matching 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.

FilterMatchesDoesn't match
sensors/+/temperaturesensors/kitchen/temperaturesensors/kitchen/air/temperature
sensors/#sensors, sensors/kitchen/temperaturesensor/kitchen
+/+a/b, /financefinance
#every topic that doesn't start with $$SYS/broker/uptime
  • Both wildcards must take up a whole level: sensors+ and sensors/temp# are invalid.
  • # must be the last level: sensors/#/temperature is 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/telemetry

Enter 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:

  • topic lines apply only to the user section they appear in. Lines before the first user line apply to anonymous clients.
  • pattern lines apply to every client, with %c and %u replaced by its client ID and username.
  • Access is read, write, readwrite (the default) or deny. 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 as devices/%c/# scopes each device to its own topics.
  • Don't start topics with /. It adds an empty first level, and /devices/… silently stops matching devices/#.
  • 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.