MQTT Client

Enter the URL of an MQTT-over-WebSocket broker (ws:// or wss://) and press Connect: your browser connects straight to the broker and you can subscribe and publish. This site’s server relays nothing. A browser cannot reach plain TCP (port 1883).

On-deviceNetwork lookupMobile friendly
ConnectionNot connected

A ws:// or wss:// URL (e.g. wss://broker.example.com:8084/mqtt). A browser cannot use plain TCP (mqtt://, port 1883), so use the port on which the broker has MQTT over WebSocket enabled. The page does not connect when it opens. Only when you press Connect does your browser connect directly to the other side. No public test broker is built in (topics on a public broker can be read by anyone, so do not send secrets).

If empty, the tool makes a 14-character ID starting with libra-. If two connections use the same ID, the broker drops the older one.

0 to 65535; 0 turns it off. When nothing is sent for this long, the browser’s MQTT library sends a PINGREQ.

Hidden on screen, never saved, never written to the log.

Leave empty to not set it. 0 to 4294967295.

Connection settings (URL etc.) are saved in this browser. The query (after ?), user info and credentials are not saved.

If it does not connect (most common first)

The browser connects straight to the other side. This site’s server does not relay anything.

  1. The URL is not an MQTT-over-WebSocket one. A browser cannot connect to plain TCP (mqtt://, 1883). Enable a WebSocket listener in the broker and use its port and path (e.g. /mqtt).
  2. The broker refuses the Origin. The browser always sends this page’s Origin (https://tools.itlibra.com). With a broker that has an allow list, allow this Origin. The browser does not show why it was refused.
  3. This page is https but the broker address is ws:// (mixed content). Use wss://.
  4. The certificate of a wss:// address has a problem (self-signed, expired, wrong host name). Open the same address with https:// in another tab to check.
  5. The WebSocket sub-protocol must be mqtt, which the library adds itself. A reverse proxy that does not pass the Upgrade header blocks the connection.
  6. Authentication refused it. Check the user name, the password and the broker’s limits on client IDs (ACL). The code of the connect answer appears in the log.
  7. The broker is down, or a firewall closes the port.
Subscribe

+ is one level, # is everything below (last only). With v5, shared subscriptions ($share/group/filter) also work.

0 at most once, 1 at least once, 2 exactly once.

Subscriptions

No subscriptions.

Publish

Wildcards (+ #) cannot be used.

v5 properties (optional)

Not used while connected with v3.1.1.

Templates (save what you send and send it again)

Saved only inside this browser (up to 30). Do not put passwords, tokens or other secrets in them.

No saved templates.

Message log

Searches event names, topics and bodies (binary as hex and as text).

0 messages logged (0 shown)

No messages yet. Once connected, what you send and receive is listed here (newest first).

Selected message

Select a message in the list to see its content.

How to use

  1. Enter the broker’s WebSocket URL (e.g. wss://broker.example.com:8084/mqtt). Set the MQTT version (v3.1.1 or v5), client ID, user name and password as needed.

  2. Press Connect (Ctrl/⌘+Enter also works). Wait until the status says Connected. If it fails, read the code of the answer in the log and “If it does not connect”.

  3. Under Subscribe, enter a topic filter (the + and # wildcards work) and a QoS. Messages that arrive are listed in the log on the right with their topic, QoS and retain flag.

  4. Under Publish, enter the topic, QoS, retain and payload (text, hex or Base64). With v5 you can add Content Type, Response Topic, an expiry and user properties.

  5. Search the log, read JSON formatted or binary as hex, and save it as JSON Lines or text. Messages you publish often can be saved as templates.

What it does

Connects straight from your browser to the broker

Connecting, subscribing and publishing happen only between your browser and the broker. This site’s server neither relays nor stores the traffic. Opening the page does not connect; only pressing Connect does. No public test broker is built in.

Explains why plain TCP is out

A browser cannot open a TCP socket, so mqtt:// and port 1883 are not reachable. Use the ws:// or wss:// port on which the broker has MQTT over WebSocket enabled. If you enter mqtt://, the tool says so.

v3.1.1 and v5, with topic checks

Connect with v3.1.1 or v5. Before sending, it checks where + and # are placed in a topic filter, wildcards in a topic to publish to, and shared subscriptions ($share/…, v5 only) against the MQTT rules. A received message shows which subscription filters matched.

QoS, retain and v5 properties

Set QoS 0, 1 or 2 for subscribing and publishing, retain, and for v5 the Content Type, Response Topic, message expiry, Payload Format Indicator and user properties. The QoS the broker granted is logged.

Search, format and save the log

Up to 2,000 messages and about 50 MB in total are logged. Filter by topic or text, read JSON formatted and binary as hex, and save as JSON Lines or text.

Use cases

  • Check that a broker under development works, by subscribing and publishing
  • See which topics a wildcard subscription (sensors/+/temperature, sensors/#) matches
  • Check how QoS 0, 1 and 2 and retain behave (does a stored message arrive right after subscribing?)
  • Compare why a connection is refused (authentication, client ID) in v3.1.1 and v5
  • Narrow down why a browser cannot connect to MQTT (WebSocket port, Origin, certificate)

Supported formats

Payload

Text (UTF-8)Hex (e.g. de ad be ef)Base64 (standard or URL-safe)

Capability matrix

FeatureSupportNotes
Connect over MQTT over WebSocket (ws://, wss://) with v3.1.1 or v5Supported—
User name, password, client ID, clean start and keep aliveSupported—
Subscribe (+ and # wildcards, QoS 0–2) and unsubscribeSupported—
Publish (QoS 0–2, retain, text/hex/Base64, the main v5 properties)Supported—
Save what you publish as templates and publish it againSupportedStored only inside this browser
Automatic reconnect after a dropPartialOff by default. When on, it has a limit of 1 to 10 attempts and subscribes again
Plain TCP (mqtt://, port 1883)Not supportedA browser cannot open a TCP socket. Use the WebSocket port
Will message, TLS client certificates, v5 enhanced authenticationNot supported—
Connecting to brokers your browser cannot reachNot supportedThis site’s server does not relay

Limits & notes

  • One message is cut at 1 MB (1,048,576 characters of text or 1,048,576 bytes of binary); anything beyond is not logged. Publishing is limited to 1 MB as well. With v5, the connect tells the broker to send packets of at most 2 MB (v3.1.1 has no such mechanism).
  • The log keeps the newest 2,000 messages and about 50 MB in total, dropping the oldest first. The list shows the newest 300.
  • Subscribing, unsubscribing and publishing together are limited to 20 per second.
  • The answer to the connect is waited for 15 seconds.
  • A client ID can be up to 256 characters. Some brokers accept only up to 23 letters and digits (the MQTT v3.1.1 rule is that a broker must accept those).
  • Only the URL (without query and user info), the version, the client ID, the subscribe and publish settings and the templates are saved. The user name and password are not.
  • How QoS and retain are handled differs between broker implementations. The granted QoS is shown in the log.

Privacy & safety

The only server contacted is the broker at the URL you enter. Traffic goes straight from your browser to it; this site’s server neither relays nor stores it. The password is not saved and not written to the log. Topics on a public broker can be read by anyone, so do not publish secrets. The log disappears when you close the page.

FAQ

Can a browser connect to an MQTT broker on port 1883?
No. A browser cannot open a TCP socket, so mqtt:// and 1883 are out. Enable MQTT over WebSocket in the broker and use that ws:// or wss:// port (for example 8083, 8084 or 9001, depending on the setup).
Why is my connection refused?
The code of the connect answer tells. In v3.1.1, 4 is a wrong user name or password, 5 is not authorized and 2 is a rejected client ID. In v5, 0x86 is bad credentials, 0x87 is not authorized and 0x85 is a rejected client ID. The tool writes the meaning of the code into the log.
What is the difference between QoS 0, 1 and 2?
QoS 0 is at most once (may be lost), QoS 1 is at least once (may repeat) and QoS 2 is exactly once. The QoS actually used is the lower of the publish QoS and the subscription QoS.
What is retain?
When you publish with retain, the broker keeps the last message of that topic and delivers it right away to anyone who subscribes later. The tool marks stored messages with “retain” in the log.
What is the difference between the + and # wildcards?
+ matches one level; # matches all the remaining levels and may only be last. sensors/+/temperature matches sensors/room1/temperature, and sensors/# matches everything under sensors. A topic starting with $ (such as $SYS) is not matched by a filter that starts with + or #.
How is this different from the WebSocket and Socket.IO clients?
This tool speaks the MQTT protocol (subscribe, publish, QoS). For raw WebSocket messages use the WebSocket client; for Socket.IO events use the Socket.IO client.

Last updated: