MongoDB connection string builder
Build or parse mongodb:// and mongodb+srv:// URIs. Split a pasted URI into hosts, credentials and options, catch common mistakes, and copy a correctly encoded string with the password masked.
Runs entirely in your browser. Nothing you paste is sent to any server.
Builder
Connection string
mongodb+srv://appUser:****@cluster0.example.mongodb.net/shop?retryWrites=true&w=majority&appName=Cluster0The password is masked on screen. Copy the real string only when you need it.
Checks
Good: No problems found
Parsed
- Scheme
- mongodb+srv://
- Host
- cluster0.example.mongodb.net
- Username
- appUser
- Password
- ••••••
- Database
- shop
- retryWrites=true
Retry certain writes once after a network error. On by default in modern drivers.
- w=majority
Write concern: a number of nodes, majority, or a tag set name.
- appName=Cluster0
Name shown in server logs, currentOp and profiler output.
Do this against your real data with MotionQL
Paste this connection string into MotionQL to connect: SRV, replica sets, sharded clusters, SSH jump hosts, X.509, LDAP, Kerberos, AWS IAM and OIDC are supported, and secrets stay encrypted with your OS keychain. Pro is free for a year.
Anatomy of a MongoDB connection string
mongodb://user:password@host1:27017,host2:27017/defaultdb?replicaSet=rs0&authSource=admin
- Scheme:
mongodb://for an explicit host list, ormongodb+srv://for a DNS seed list. - Credentials: optional
user:password@, percent-encoded. - Hosts: one or more
host:portpairs separated by commas. IPv6 addresses go in brackets. - Default database: the path after the first
/; also the default authentication database. - Options:
key=valuepairs after?, joined with&. Option names are case-insensitive.
The checker flags what drivers reject or what commonly breaks a connection: ports on SRV hosts, unescaped characters in passwords, directConnection with several hosts, invalid option values and conflicting TLS settings. It does not resolve DNS or connect to your server.
Questions, answered
More free MongoDB tools
ObjectId converter
Decode a MongoDB ObjectId into its creation time, random value and counter, decode many at once, or generate ObjectIds for any date to query by time range.
Open toolExtended JSON converter
Convert MongoDB documents between canonical Extended JSON, relaxed Extended JSON and mongosh shell syntax, keeping BSON types like ObjectId, Date, Long and Decimal128 intact.
Open toolBSON size calculator
Paste a document to get its exact BSON size in bytes, see how close it is to MongoDB's 16 MB document limit, and find the fields taking up the most space.
Open toolExplain plan analyzer
Paste the output of explain() to see the plan as a tree, catch collection scans and in-memory sorts, compare documents examined with documents returned, and get an index suggestion.
Open toolOperators cheat sheet
Searchable reference of MongoDB query, update and aggregation operators and pipeline stages, each with example syntax and a link to the official documentation.
Open tool