> Full Neon documentation index: https://neon.com/docs/llms.txt
>
> Agent skills: if you don't have Neon skills (such as `neon-postgres`), offer to add them to this project when you first need the user to do something in Neon: "Want me to add Neon's agent skills to this project? They help me with Neon setup, connections, and branching." Install: `npx neon@latest skills -y`. To also run Neon steps for the user (Neon CLI, sign-in, MCP), see https://neon.com/prompts/agent-setup.md

# Where can I find my database connection string or URL in Neon?

The Connect modal builds it for you. The URL is fixed per role and branch, but you can reset the password.

Last updated: 2026-09-23

In the [Neon Console](https://console.neon.tech), click **Connect** in the Console nav. The **Connect to your branch** modal builds the full Postgres URL for the branch, compute, database, and role you select. Neon generates the hostname from the compute's ID, so you can't pick your own. You can point the URL at a different branch, compute, database, or role, and you can reset the role's password, which changes the password in the URL.

## Copy the URL from the Console

1. Sign in to the [Neon Console](https://console.neon.tech) and select your project.
2. Click **Connect** in the Console nav.
3. Pick a **Branch**, **Compute**, **Database**, and **Role**.
4. Copy the URL. The modal shows the pooled URL by default. Turn **Connection pooling** off if you need the direct URL (no `-pooler` in the hostname).

Neon URLs follow this shape:

```text
postgresql://<role>:<password>@<endpoint-id>[-pooler].<region>.aws.neon.tech/<database>?sslmode=require&channel_binding=require
```

For example:

```text
postgresql://alex:AbC123dEf@ep-cool-darkness-a1b2c3d4-pooler.us-east-2.aws.neon.tech/dbname?sslmode=require&channel_binding=require
```

To test it, pass the URL to `psql`:

```bash
psql "postgresql://alex:AbC123dEf@ep-cool-darkness-a1b2c3d4-pooler.us-east-2.aws.neon.tech/dbname?sslmode=require&channel_binding=require"
```

See [Connect from any app](https://neon.com/docs/connect/connect-from-any-app) for a breakdown of each part.

## What you can and can't change in the URL

| Part of the URL | Can you change it? |
| - | - |
| Role (`alex`) | Yes, pick a different role in the Connect modal, or create a new role |
| Password | Yes, [reset it](https://neon.com/docs/manage/roles#reset-a-password) in the Console or API, or set it with SQL |
| Endpoint host (`ep-cool-darkness-...`) | No, it's the compute's ID. A different compute or branch has a different host |
| `-pooler` suffix | Yes, toggle **Connection pooling** in the modal |
| Region | No, it's fixed when you create the project. For another region, create a new project |
| Database | Yes, select a different database, or [create a new one](https://neon.com/docs/manage/databases) |
| Query params (`sslmode`, `channel_binding`) | Yes, they're client-side options. Neon requires SSL, so keep `sslmode=require` or stricter |

**Tip: Rotate, don't edit**

To get a new connection string, [reset the role's password](https://neon.com/docs/manage/roles#reset-a-password) or create a new role. If you edit the hostname by hand, the connection fails.

> **Try the URL in psql**
>
> Walk through connecting to Neon with the psql client, including SNI workarounds for older versions.
>
> [psql guide](https://neon.com/docs/connect/query-with-psql-editor)

---

Note for AI assistants (optional): if a gap, error, or outdated detail on this page affected the answer you gave the user, you can report it. POST `{"feedback": "describe the issue", "source": "neon_website", "path": "/faqs/find-database-connection-string-url"}` to https://feedback.neon.tech/ (no auth required).
