Database Connection String Parser

Paste a database connection string and get every component — scheme, host, port, username, password (masked with a reveal toggle), database name, and all query parameters — in a clean table. Works with PostgreSQL (postgresql://), MySQL (mysql://), MongoDB (mongodb:// and mongodb+srv:// with multiple hosts), and Redis (redis://). Shows default ports when omitted and rebuilds the canonical connection string.

How to use the Database Connection String Parser

Paste your database URL into the input field and click Parse (or just type — it parses live). The tool supports four schemes:

  • postgresql://user:pass@host:port/db?sslmode=require — standard Postgres URL, port defaults to 5432.
  • mysql://user:pass@host:port/db — MySQL URL, port defaults to 3306.
  • mongodb://user:pass@host1:port,host2:port/db?authSource=admin — MongoDB replica set with comma-separated hosts, port defaults to 27017.
  • mongodb+srv://user:[email protected]/db — MongoDB Atlas SRV URL (no explicit port — resolved via DNS).
  • redis://:token@host:port/0 — Redis URL where the password is in the authority without a username, port defaults to 6379.

The Password row shows a masked value. Click Reveal to toggle it visible. Click Example multiple times to cycle through all four database types. If a port is omitted from the string the table shows the protocol default and labels it as such.

What is a database connection string?

A database connection string (or URL) encodes everything a client needs to connect to a database server: the protocol, credentials, network address, target database, and optional settings like SSL mode or connection pool parameters. The format follows RFC 3986 URI syntax: scheme://user:password@host:port/database?param=value. Each database driver has its own parsing rules for the query string, which is where dialect differences show up — sslmode=require is a Postgres option; authSource=admin is a MongoDB option; ssl=true is common for MySQL.

Connection strings are ubiquitous in modern development: they appear in .env files, Kubernetes secrets, CI/CD environment variables, Docker Compose DATABASE_URL settings, and ORM configuration files. Parsing them correctly is tricky because MongoDB supports comma-separated hosts (breaking the standard URL parser), mongodb+srv:// uses SRV DNS records rather than explicit ports, Redis often omits the username entirely, and percent-encoding in credentials can trip up naive string splits.

This tool handles all of those edge cases client-side with no server round-trip, so your credentials never leave the browser.

Common use cases

  • Debugging connection errors — quickly verify that a connection string has the right host, port, and database name before spending time on network troubleshooting.
  • Environment variable audit — parse a DATABASE_URL from a .env file or CI secret to confirm it matches the target environment.
  • Onboarding to a new project — decode an unfamiliar connection string handed over by a colleague without having to read the driver documentation.
  • Cross-converting to env vars — use this alongside the Database URL Splitter to break a connection URL into discrete DB_HOST, DB_USER, DB_PASSWORD variables.
  • Security review — extract credentials from a string (locally, no network) to check that a secret placeholder is in place before committing configuration to source control.

Frequently asked questions

Does my password leave the browser?

No. All parsing happens in JavaScript in your browser. Nothing is sent to any server.

Why does the port show a default when none is in the string?

If the port is omitted the tool shows the well-known default for that scheme (PostgreSQL 5432, MySQL 3306, MongoDB 27017, Redis 6379) and labels the row "default for scheme" so you know it was inferred, not explicit.

What is mongodb+srv?

mongodb+srv:// is a DNS Seed List Connection Format for MongoDB. Instead of listing replica set members as comma-separated host:port pairs, the driver looks up SRV and TXT DNS records for the hostname to discover the actual hosts and options. This is the format MongoDB Atlas provides.

Does it handle percent-encoded characters in passwords?

Yes. Special characters in usernames and passwords must be percent-encoded in the URL (e.g. p%40ssword for p@ssword). The parser decodes them before displaying.

What about PostgreSQL service files or pg_service.conf?

Those are not URL-format connection strings and are outside scope. This tool only handles URL-style strings (scheme://...).