Database Connection String Builder
Build (or reverse-parse) connection strings for PostgreSQL, MySQL, MongoDB, Redis, and 4 more — live preview, env-var + code snippet.
About this ToolHow it works, benefits & use casesTap to collapse
Build a correct database connection string for eight engines — PostgreSQL, MySQL, MariaDB, MongoDB, Redis, Microsoft SQL Server, SQLite, and Oracle — from simple fields, and get the matching env-var line and client code alongside it. Pick an engine and the default port fills in automatically (5432, 3306, 27017, 6379, and so on); enter host, database, and username, and the URI assembles live with the username and password percent-encoded. Enabling SSL adds the right marker per engine (sslmode=require for Postgres, rediss:// for Redis, +srv for MongoDB, Encrypt=true for SQL Server). The output bundles three things: the connection URI, a ready-to-paste environment variable (DATABASE_URL, MONGODB_URI, REDIS_URL, etc.), and a copy-paste code example for that engine's common Node client. A reverse "Parse a URI" mode breaks an existing connection string back into its parts. Passwords live in memory only — they are never written to localStorage, the URL, or share links, and parsed passwords come back masked as ****.
How to Use
- 1Choose "Build from fields" mode and select your database type from the button row — the default port fills in for you.
- 2Enter host, port, database, username, and password (Redis and SQLite hide the fields they don't use), and toggle "Enable SSL/TLS" if needed.
- 3Click "Build connection string" to produce the URI; review any security warnings shown below.
- 4Copy the combined output — the URI, the environment-variable line, and the client code example for that engine.
- 5To go the other way, switch to "Parse a URI" mode, paste a connection string, then click "Use in builder" to load its parts back into the form.
Key Benefits
- Eight engines: PostgreSQL, MySQL, MariaDB, MongoDB, Redis, MSSQL, SQLite, Oracle
- Automatic default ports and engine-correct SSL markers (sslmode, rediss, +srv, Encrypt)
- Username and password percent-encoded so special characters never break the URI
- Bundled env-var line and ready-to-paste Node client code for each engine
- Reverse "Parse a URI" mode decomposes an existing string into editable fields
- Inline warnings for weak/default passwords and SSL disabled on non-local hosts
- Password stays in memory only — never persisted to storage, URL, or share links
Common Use Cases
- Assembling a DATABASE_URL for a new Postgres or MySQL service without misremembering the format
- Generating a MongoDB +srv URI for an Atlas cluster with the right options
- Producing a rediss:// string with TLS for a managed Redis instance
- Decomposing a connection string from a config file to inspect host, port, and database
- Getting starter client code (pg, mysql2, mongodb, ioredis, mssql, oracledb) for a new project
Password not saved. The password stays in memory only — never written to localStorage, the URL, or share links.
Database type
Live preview
-- Connection URI
postgresql://localhost:5432/mydb
-- Environment variable
DATABASE_URL="postgresql://localhost:5432/mydb"
-- Code example
// Node.js (pg)
import { Pool } from 'pg';
const pool = new Pool({
connectionString: process.env.DATABASE_URL,
ssl: false,
});
// TypeScript (Prisma)
// In .env file: DATABASE_URL="postgresql://localhost:5432/mydb"
// prisma/schema.prisma:
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}Was this tool helpful?
Share Your Experience
Help others discover this tool!
Related tools
- URL Encoder/DecoderEncode and decode URL strings
- Database Schema VisualizerPaste SQL DDL and get a live ER diagram with typed columns, PK/FK/unique markers, and relationships; export to Mermaid, PlantUML, DBML, ASCII, or JSON
- String ReverserReverse any text string
- Tailwind Config GeneratorVisually build a Tailwind config - theme extend, colors, spacing, fonts, screens, plugins - and export it as a v3 JS config or a v4 @theme CSS block
- TOML to JSONConvert TOML to JSON format
- MCP Server Config GeneratorGenerate valid Model Context Protocol server config for Claude Desktop, Claude Code, Cursor, VS Code, Windsurf & Zed
No. The password is held in local component state only — it is never written to localStorage, encoded into the URL, or included in share links. When you parse an existing connection string, the password is returned masked as **** rather than echoed back, and switching engine or importing a parsed URI clears the password field.
Each engine uses its own convention: PostgreSQL appends ?sslmode=require, MySQL adds ?ssl=true, Redis switches the scheme to rediss://, MongoDB switches to mongodb+srv://, and SQL Server adds Encrypt=true. The generated code example also reflects the SSL setting (for example, pg's ssl option).

