PostgreSQL Connection String Builder

Fill in the host, port, database, user and password, and this postgres connection string builder writes the URI PostgreSQL clients expect, with reserved characters in the password percent-encoded. Paste a string you already have and it travels the other way, into the fields.

postgresql://

A postgresql:// or postgres:// URI, a jdbc:postgresql:// URL, a SQLAlchemy URL, or the whole DATABASE_URL= line out of an env file. Ctrl+Enter fills the fields.

Port 6543 on the shared pooler. The user name carries the project ref, and transaction mode does not support prepared statements, which is what Prisma's pgbouncer=true is for.

Connection details

Shown in full in the result below, so it is worth hiding the field if someone is behind you.

Percent-encoded for the URI
user
postgres.abcdefghijklmnopqrstnothing to escape
password
p%40ssw0rd%231@%40#%23

Only try SSL. The certificate is not checked unless a root CA file is present.

What pg_stat_activity shows for this connection.

Command-line options for the session. Spaces become %20 and = becomes %3D in the URI.

Output format
postgresql://postgres.abcdefghijklmnopqrst:p%40ssw0rd%231@aws-0-eu-central-1.pooler.supabase.com:6543/postgres?sslmode=require

The libpq URI. psql and most drivers read this form as it stands.

Everything here is computed in this tab. The page has no server to send a password to, nothing you type is stored or logged, and Ctrl or Cmd with Enter copies the string above.

What it does and how to use it

Pick the service you connect to and the fields arrive shaped the way that service documents them. Whatever you end up with is rewritten below as a psql invocation, a JDBC URL, a SQLAlchemy create_engine call, a Prisma or Drizzle DATABASE_URL, and the seedfast connect command.

Backwards works as well. Drop a string into the box at the top, press Fill the fields, and the credentials come back decoded with sslmode and options split into their own controls.

The libpq URI format and the characters that break it

libpq documents the URI it accepts as a single line of grammar, and asks for percent-encoding wherever a part of it carries a symbol with special meaning.

postgresql://[user[:password]@][host][:port][/dbname][?param=value]

Skip the encoding and the failure is rarely subtle. A # begins the fragment and a / ends the authority, so postgresql://user:pa#ss@host/db is rejected by pg-connection-string and by the browser's own URL parser alike. Where the stray character is an @, nothing is rejected at all. The parser splits at the last one it finds, reads postgresql://user:p@sshost/db as the password p on a host called sshost, and hands you a complaint about DNS.

Everything after the ? is parameters. sslmode=require refuses an unencrypted connection and stops there, leaving the certificate unexamined until you ask for verify-ca. Session settings ride in options, where -c search_path=app becomes ?options=-c%20search_path%3Dapp once the space and the = are escaped.

On Supabase the port carries meaning of its own. 6543 on the pooler host is transaction mode, where consecutive statements land on whichever backend is free and nothing prepared survives, which is what Prisma's pgbouncer=true is for, while 5432 on that host holds one backend for the whole session.

FAQ

Frequently asked questions

The labelled fields become a PostgreSQL connection URI with the credentials percent-encoded, and the same connection is printed in seven formats under it.

It does not. The page has no server to send it to, and closing the tab clears what you typed.

Write %40 for the @ and %23 for the #, which happens here as you type. Everything else RFC 3986 reserves is escaped the same way.

The client refuses to connect without TLS and stops there. Checking the certificate against the host you meant is what verify-full is for.

6543 is the pooler in transaction mode, where each statement can land on a different backend, and 5432 keeps one backend for the whole connection.

Yes, along with a SQLAlchemy URL, a psql command, or the whole DATABASE_URL line out of an env file.

Every tool under /tools is free and takes no account. Point whatever needs a database at the string, and the Seedfast quick start covers the CLI side of an empty schema.