Supabase Connection String

Enter your project ref and password, or paste any Supabase string, and get the direct, session pooler and transaction pooler versions with the password encoded.

Client-side only, nothing leaves your browser

Paste the session pooler string from the Connect dialog and the fields below fill in, including the exact pooler host.

The pooler host is aws-0-us-east-1.pooler.supabase.com. Supabase runs more than one pooler cluster in some regions (aws-0, aws-1 and so on), so check it against the Connect dialog. A wrong cluster gives "Tenant or user not found".

Connection strings

Direct connection · port 5432
postgresql://postgres:[YOUR-PASSWORD]@db.[PROJECT-REF].supabase.co:5432/postgres?sslmode=require

IPv6 only unless the IPv4 add-on is enabled. On an IPv4-only network (Vercel, GitHub Actions, Render, many home ISPs) use the session pooler instead.

Session pooler · port 5432
postgresql://postgres.[PROJECT-REF]:[YOUR-PASSWORD]@aws-0-us-east-1.pooler.supabase.com:5432/postgres?sslmode=require

IPv4 on every plan. Supports everything a direct connection does, including prepared statements.

Transaction pooler · port 6543
postgresql://postgres.[PROJECT-REF]:[YOUR-PASSWORD]@aws-0-us-east-1.pooler.supabase.com:6543/postgres?sslmode=require

For serverless and edge functions. Turn off prepared statements, and don't rely on SET, LISTEN/NOTIFY or temp tables across transactions.

Dedicated pooler (Pro plan) · port 6543
postgresql://postgres:[YOUR-PASSWORD]@db.[PROJECT-REF].supabase.co:6543/postgres?sslmode=require

PgBouncer for your project only. Needs IPv6 or the IPv4 add-on.

For your stack

URI
postgresql://postgres.[PROJECT-REF]:[YOUR-PASSWORD]@aws-0-us-east-1.pooler.supabase.com:5432/postgres?sslmode=require
psql
psql "postgresql://postgres.[PROJECT-REF]:[YOUR-PASSWORD]@aws-0-us-east-1.pooler.supabase.com:5432/postgres?sslmode=require"
Python (SQLAlchemy with psycopg 3)
postgresql+psycopg://postgres.[PROJECT-REF]:[YOUR-PASSWORD]@aws-0-us-east-1.pooler.supabase.com:5432/postgres?sslmode=require
Node.js (pg)
new Pool({ connectionString: "postgresql://postgres.[PROJECT-REF]:[YOUR-PASSWORD]@aws-0-us-east-1.pooler.supabase.com:5432/postgres?sslmode=require" })
.NET (Npgsql)
Host=aws-0-us-east-1.pooler.supabase.com;Port=5432;Database=postgres;Username=postgres.[PROJECT-REF];Password=[YOUR-PASSWORD];SSL Mode=Require
JDBC
jdbc:postgresql://aws-0-us-east-1.pooler.supabase.com:5432/postgres?user=postgres.[PROJECT-REF]&password=[YOUR-PASSWORD]&sslmode=require

Prisma (.env)

DATABASE_URL="postgresql://postgres.[PROJECT-REF]:[YOUR-PASSWORD]@aws-0-us-east-1.pooler.supabase.com:6543/postgres?pgbouncer=true&connection_limit=1&sslmode=require"
# Migrations: session pooler, or the direct connection if you have IPv6
DIRECT_URL="postgresql://postgres.[PROJECT-REF]:[YOUR-PASSWORD]@aws-0-us-east-1.pooler.supabase.com:5432/postgres?sslmode=require"

Prisma 7: point prisma.config.ts at DIRECT_URL when you run migrations. Prisma 6 and older: set directUrl = env("DIRECT_URL") in schema.prisma.

Direct, Session Pooler or Transaction Pooler?

  • Direct connection: db.<ref>.supabase.co:5432, user postgres. Use it for long-running servers, migrations, pg_dump and GUI clients when your network has IPv6 or the project has the IPv4 add-on. Every Postgres feature works.
  • Session pooler: pooler host, port 5432, user postgres.<ref>. Use it when you need the same features as a direct connection but your network is IPv4 only. Each client keeps one database connection for as long as it stays connected.
  • Transaction pooler: pooler host, port 6543, user postgres.<ref>. Use it for serverless and edge functions that open many short connections. A connection goes back to the pool after each transaction, so turn off prepared statements and avoid SET, LISTEN/NOTIFY and temp tables that need to outlive a transaction.
  • Dedicated pooler: db.<ref>.supabase.co:6543, user postgres, Pro plan and above. A PgBouncer instance for your project only. It supports prepared statements but needs IPv6 or the IPv4 add-on.

Frequently asked questions

Where do I find my Supabase connection string?
Open your project in the Supabase dashboard and click Connect at the top of the page. The dialog lists the direct, session pooler and transaction pooler strings, each with a [YOUR-PASSWORD] placeholder. Supabase does not show your current database password anywhere, so if you have lost it, reset it under Database > Settings and update every app that uses the old one.
What is the difference between a direct connection and the session pooler in Supabase?
A direct connection goes straight to Postgres at db.<ref>.supabase.co and only resolves over IPv6 unless you pay for the IPv4 add-on. The session pooler runs through Supavisor on an IPv4 address and gives each client its own database connection for the whole session, so features like prepared statements and LISTEN still work. Pick the direct connection when your network supports IPv6, and the session pooler when it does not.
Should I use the transaction pooler or the session pooler?
Use the transaction pooler on port 6543 for serverless platforms such as Vercel Functions, Cloudflare Workers or AWS Lambda, where hundreds of short-lived instances would otherwise exhaust your connection limit. Use the session pooler on port 5432 for a long-running server, migrations and anything that relies on session state. A common setup is both at once, such as Prisma reading DATABASE_URL from the transaction pooler and running migrations through DIRECT_URL on the session pooler.
How do I get an IPv4 connection string for Supabase?
Use the session or transaction pooler string, since the shared pooler has an IPv4 address on every plan, including Free. If you need the direct connection over IPv4, enable the paid IPv4 add-on on a Pro plan or higher, which replaces the IPv6 DNS record with an IPv4 one. Vercel, GitHub Actions, Render and Retool only connect over IPv4, so they need one of these two options.
Why is my Supabase connection string not working?
The most common cause is a password with characters like @, # or ? that were not percent-encoded, or square brackets left in from the [YOUR-PASSWORD] placeholder. "Tenant or user not found" means the pooler could not match your host and username, usually because the username is postgres instead of postgres.<ref> or the aws-0 / aws-1 part of the host is wrong. A timeout on the direct host usually means your network has no IPv6, so switch to the session pooler.
Supabase

Need a Supabase GUI Client?

1bench is a modern database client for Supabase and 20+ other databases. Query, browse, and manage your data visually.

Learn More