Tools / Connection String Parser & Builder

Connection String Parser & Builder.

Parse database URLs, JDBC, PDO DSN and ADO.NET strings, or build them, for Postgres, MySQL, SQL Server, MongoDB, Redis.

Runs in your browser

Comma-separate several host:port pairs for replica sets

Leave empty for the default port

One key=value per line, e.g. sslmode=require

Ctrl/⌘ + Enter to run · Ctrl/⌘ + Shift + C to copy the result

Result
Components
Formats

About Connection String Parser & Builder

Connection String Parser & Builder reads a database connection string in any of the common shapes and shows what is inside it: engine, hosts, port, database, user name, password and extra options. It accepts URIs such as postgres://, mysql://, mongodb:// and mongodb+srv:// with several hosts, redis:// and rediss://, amqp:// for RabbitMQ, JDBC URLs including SQL Server's semicolon form, PHP PDO DSNs, ADO.NET key=value strings with quoted values, and libpq keyword strings. It then writes the same connection back out in the other formats your stack may need: a URI, a JDBC URL, a PDO DSN, ADO.NET for Npgsql, MySQL or SQL Server, libpq keywords and the DB_ or REDIS_ lines of a Laravel .env file. Build mode does the reverse from separate fields. Percent-encoding is the most common source of trouble: a password like p@ss/w0rd must be written p%40ss%2Fw0rd inside a URI, otherwise drivers split the string at the wrong @ or slash. The parser decodes such escapes, warns when credentials contain characters that should have been encoded, and the builder encodes them for you. Other traps it flags are a port on a mongodb+srv URI, which is not allowed, and a non-numeric Redis database. Defaults are filled in when a port is missing, for example 5432 for PostgreSQL. Because connection strings hold passwords, this tool is marked sensitive: the input is never put in the page link or history, and all processing happens in your browser with no network requests.

How to Use

  1. Paste a connection string in parse mode, or switch to build mode and fill in host, database and credentials.
  2. Check the components, including decoded credentials and options, and any notes about encoding problems.
  3. Copy the format you need from the formats table, such as JDBC or Laravel .env.

Frequently Asked Questions

Why does my password break the connection URL?

Characters such as @, /, :, ? and

Which formats can it read?

Database URIs (PostgreSQL, MySQL, MariaDB, SQL Server, MongoDB including +srv, Redis, AMQP), JDBC URLs, PHP PDO DSNs, ADO.NET key=value strings and PostgreSQL libpq keyword strings.

Why is an ADO.NET string read as SQL Server?

SQL Server and MySQL Connector/NET use the same Server=…;Database=… style, so the parser cannot tell them apart. Strings with Host= or Username= are read as Npgsql (PostgreSQL). Use build mode to choose MySQL explicitly.

Is my password stored or sent anywhere?

No. The tool runs in your browser, makes no network requests, and as a sensitive tool it never writes your input into the URL or browser history.

Related Tools