MQTT Connection String Generator
Generate connection strings and URIs for MQTT brokers. AWS IoT, Azure IoT Hub, HiveMQ, Mosquitto, and custom brokers.
Select Broker Type
Connection Settings
Enter your MQTT broker hostname
Connection Strings
MQTT URI
mqtt://broker.example.com:1883
WebSocket URI
ws://broker.example.com:8083/mqtt
Secure MQTT (TLS)
mqtts://broker.example.com:8883
Secure WebSocket
wss://broker.example.com:8084/mqtt
Client ID: -
Code Examples
JavaScript (Paho MQTT)
const client = new Paho.Client(
"broker.example.com",
8083,
"my-device-001"
);
client.connect({
onSuccess: () => console.log("Connected!"),
useSSL: false
});
Python (paho-mqtt)
import paho.mqtt.client as mqtt
client = mqtt.Client("my-device-001")
client.connect("broker.example.com", 1883, 60)
client.loop_start()
Common MQTT Ports
| Port | Protocol | Description |
|---|---|---|
| 1883 | MQTT | Default unencrypted MQTT |
| 8883 | MQTTS | MQTT over TLS/SSL |
| 8083 | WebSocket | MQTT over WebSocket |
| 8084 | Secure WebSocket | MQTT over Secure WebSocket |