Database Connection String Parser & Builder — Free, In Your Browser
Paste a connection string and split it into protocol, credentials, host, database, and query parameters. Or fill in the fields and get a correctly encoded URI back — plus one-click exports for .env, Node pg/mysql2 config, and Docker.
- Percent-encode passwords that contain @, :, /, ?, or # — the builder does this for you.
- Omitted ports are filled in from the dialect default: 5432 for Postgres, 3306 for MySQL, 27017 for MongoDB, 6379 for Redis.
- MongoDB replica sets use comma-separated hosts. The parser keeps every host; the Node config export uses the first.
- The email and clipboard outputs from other tools never apply here — this page does not send your URI anywhere.
Runs 100% in your browser. Connection strings and passwords are never transmitted or stored.
What a connection URI actually is
A database URL is a compact way to write everything a client needs: scheme, user, password, host, port, database name, and options. postgres://app:secret@db:5432/analytics?sslmode=require is the same information as a six-field config object, just one line so it fits in an environment variable.
The scheme names the driver more than the wire protocol. postgresql:// and postgres:// are interchangeable for libpq and node-postgres. mongodb+srv:// is DNS-based discovery, not a different credential format. redis:// and rediss:// differ only by TLS.
Passwords, encoding, and the @ problem
The authority section is user:password@host. If the password itself contains @, :, /, ?, or #, an unencoded URI is ambiguous — parsers cannot tell where the password ends. The fix is percent-encoding: p@ss:w0rd becomes p%40ss%3Aw0rd. The parser decodes those sequences; the builder encodes them so the URI stays valid.
Never commit a live connection string. Treat anything you paste here as a secret you are inspecting, not a value to share. This tool never uploads or stores the URI — it exists so you can read and rebuild one without sending it to a website that might log it.
Exports: .env, Node clients, and Docker
Most Node apps read DATABASE_URL and let the driver parse it. pg and mysql2 also accept a config object: { host, user, password, port, database }. Docker Compose and official images prefer discrete POSTGRES_* / MYSQL_* variables. The exports here are the same parsed fields in those three shapes, so you can move a URI into whichever form the next tool wants.
Frequently asked questions
Does this tool send my connection string to a server?
No. Parsing, building, and every export run in your browser. Connection strings and passwords are never transmitted or stored.
Why does my password look different after I rebuild the URI?
Special characters are percent-encoded so the URI stays unambiguous. p@ss becomes p%40ss. Drivers decode it back to the original password. The parsed password field shows the decoded value.
What port is used when I omit one?
The dialect default: 5432 for Postgres, 3306 for MySQL and MariaDB, 27017 for MongoDB, 6379 for Redis, 5672 for AMQP, 1433 for SQL Server. mongodb+srv has no numeric default — DNS supplies the hosts.
Can I parse a MongoDB replica-set URI?
Yes. Comma-separated hosts are split and shown individually. Query parameters such as replicaSet and authSource are listed separately. The Node config export uses the first host, which is what a single-endpoint client expects.