Protocols / Binary Serialization

MQTT topic matcherwith reasons for every topic

Enter one subscription filter and one published topic per line; choose the protocol version and delivery scenario.

MQTT topic matcher

Topic filter

Published topic names

Matching results

Filter and topics are processed in this browser. No broker connection or network request is made.

Protocol and delivery options

Use + for one complete level and # only as the final complete level. A topic name cannot contain either wildcard.

One filter and up to 1,000 topic lines. Empty separator lines are skipped; spaces and empty topic levels are preserved.

Enter a filter and topics to begin.

An MQTT topic matcher helps when a device publishes successfully but a subscription sees nothing. A filter may differ by one level, case, leading slash or the special treatment of a $ system topic.

Paste the filter and a batch of actual topic names to compare the rule result with the retained-message delivery result. A matching rule does not always mean an existing retained message is replayed to a new MQTT 5 shared subscription.

Why use an MQTT topic matcher?

A rule match and message delivery are separate questions.

See the exact wildcard boundary

The MQTT topic matcher marks where + consumes one level and where a final # covers its parent as well as descendants. Empty levels and $ system topics remain visible instead of being silently normalized.

Branching topic levels with one branch covering one level and another covering its parent and descendants

Separate matching from retained delivery

A shared MQTT 5 filter can match a retained topic yet a new member receives no old retained copy. The report shows that difference for every topic while ordinary new subscriptions use Retain Handling 0.

Two subscription paths both match a stored topic, while only the ordinary subscription receives the old retained message

Three checks before trusting a subscription

01

Keep topic spelling intact

Paste one filter and the published names exactly as sent. Case, spaces, leading slashes and empty levels are significant; blank separator lines alone are skipped.

  • Load the wildcard example to see why sensors//temperature is valid for a + level.
02

Choose version and delivery moment

MQTT 5 recognizes $share/group/filter; MQTT 3.1.1 treats those levels literally. Retained mode asks about old retained messages when a new subscription joins, not about future publishes.

  • The shared example sets MQTT 5 and the retained scenario together.
03

Read the per-line reason

A mismatch names its first differing level; a retained shared row distinguishes a matching filter from no initial replay. Export unlocks only when the result matches current inputs.

  • Turn off auto test for Ctrl/Cmd+Enter when editing a large list.

Filter behavior made inspectable

Level-accurate wildcard test

The MQTT wildcard tester applies + to one complete level and # only at the end, including a zero-level match of its parent. It does not reinterpret * or ? as wildcard operators.

Batch topic filter report

Compare up to 1,000 topic names against one MQTT topic filter. Each row retains its original line number and explains the first mismatch; invalid names remain separate from ordinary misses.

Version-aware shared subscription

MQTT 5 strips $share/group/ before matching; MQTT 3.1.1 keeps that prefix literal. The report never claims which member a broker will select.

Where this prediction stops

A topic name is not a glob
Only complete + and final # levels are wildcard syntax in the filter. A published name containing either is invalid, and a leading wildcard cannot catch a $SYS topic.
The version changes $share
Standard MQTT shared subscription syntax exists in 5.0. In 3.1.1 the same characters are compared as ordinary levels; vendor-specific broker extensions are outside this local test.
Retained mode has one defined moment
It checks the first delivery of already stored retained messages to a new subscription. MQTT 5 normal subscriptions assume Retain Handling 0; QoS, session recovery, deletion and later publishes are not modeled.
No broker authorization check
The MQTT topic matcher does not connect to a broker, publish a payload or inspect ACLs. A local filter match cannot prove that a real broker accepted a subscription or delivered a message.

MQTT topic matcher questions

Can I use a wildcard inside one MQTT topic level?

No. + must occupy a complete level, and # must be a complete final level. A filter such as sensor/room+/temp is rejected with its column, rather than treated as a glob.

Can one + wildcard match zero topic levels?

It matches exactly one level, including an empty level between slashes. Thus sensor/+ can match sensor/ but cannot match sensor without the slash.

How do I subscribe to all topics, including $SYS?

# covers ordinary topics but excludes names beginning with $. Add an explicit $SYS/# filter on the broker. This page checks one filter at a time and shows the $ exception.

Why does a shared subscription match but receive no old retained message?

In MQTT 5, $share/group/filter uses the inner filter for matching, while shared subscriptions do not replay existing retained messages to a new member. Live matching messages may still go to one group member.

Will overlapping normal and wildcard subscriptions deliver duplicate messages?

This MQTT topic matcher reports whether one filter matches each name; it cannot predict a broker's delivery count across multiple subscriptions, QoS settings or sessions. Test that behavior with your actual broker.

Still have a matching question?

Use the MQTT topic matcher now

Return to the MQTT topic matcher with a real filter and topic list; switch to retained mode only when testing an existing stored message for a new subscription.

All matching runs in your browser.