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
postgresql://postgres:[YOUR-PASSWORD]@db.[PROJECT-REF].supabase.co:5432/postgres?sslmode=requireIPv6 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.
postgresql://postgres.[PROJECT-REF]:[YOUR-PASSWORD]@aws-0-us-east-1.pooler.supabase.com:5432/postgres?sslmode=requireIPv4 on every plan. Supports everything a direct connection does, including prepared statements.
postgresql://postgres.[PROJECT-REF]:[YOUR-PASSWORD]@aws-0-us-east-1.pooler.supabase.com:6543/postgres?sslmode=requireFor serverless and edge functions. Turn off prepared statements, and don't rely on SET, LISTEN/NOTIFY or temp tables across transactions.
postgresql://postgres:[YOUR-PASSWORD]@db.[PROJECT-REF].supabase.co:6543/postgres?sslmode=requirePgBouncer for your project only. Needs IPv6 or the IPv4 add-on.
For your stack
postgresql://postgres.[PROJECT-REF]:[YOUR-PASSWORD]@aws-0-us-east-1.pooler.supabase.com:5432/postgres?sslmode=requirepsql "postgresql://postgres.[PROJECT-REF]:[YOUR-PASSWORD]@aws-0-us-east-1.pooler.supabase.com:5432/postgres?sslmode=require"postgresql+psycopg://postgres.[PROJECT-REF]:[YOUR-PASSWORD]@aws-0-us-east-1.pooler.supabase.com:5432/postgres?sslmode=requirenew Pool({ connectionString: "postgresql://postgres.[PROJECT-REF]:[YOUR-PASSWORD]@aws-0-us-east-1.pooler.supabase.com:5432/postgres?sslmode=require" })Host=aws-0-us-east-1.pooler.supabase.com;Port=5432;Database=postgres;Username=postgres.[PROJECT-REF];Password=[YOUR-PASSWORD];SSL Mode=Requirejdbc:postgresql://aws-0-us-east-1.pooler.supabase.com:5432/postgres?user=postgres.[PROJECT-REF]&password=[YOUR-PASSWORD]&sslmode=requirePrisma (.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?
What is the difference between a direct connection and the session pooler in Supabase?
Should I use the transaction pooler or the session pooler?
How do I get an IPv4 connection string for Supabase?
Why is my Supabase connection string not working?
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