Database Connection String Parser & Builder
Parse a Postgres, MySQL, MongoDB, or Redis connection URI into its parts — or build one visually
About this tool
The ToolNinja Connection String Parser breaks a database connection URI into its individual parts — scheme, user, password, host, port, database name, and query parameters — and the Builder does the reverse, assembling a valid connection string from fields you fill in. Connection strings for Postgres, MySQL, MongoDB, and Redis all follow the same general URI shape (scheme://user:password@host:port/database?params), which means they parse cleanly with the same logic — useful when you're migrating a connection string between tools, debugging why a URL-encoded character is breaking a parser, or just trying to read a long string with a password embedded in the middle of it. The password field has a reveal/hide toggle since connection strings routinely get pasted into chat windows, tickets, or screen-shared terminals — easy to accidentally expose a credential while explaining a bug.
When to use it
- →Reading a long connection string with the password, host, and params clearly separated
- →Building a new connection string field-by-field instead of hand-assembling the URI syntax
- →Debugging a connection string that's failing to parse due to an unencoded special character
- →Converting a connection string's format when migrating between database tools or ORMs
Tips
- ◆Special characters in a password (@, :, /, ?) must be percent-encoded, or they'll be misread as part of the URI structure — the Build tab handles this encoding for you automatically.
- ◆Multi-host strings, like MongoDB replica set URIs listing several hosts separated by commas, aren't supported — parse one host at a time.
- ◆The password reveal toggle defaults to hidden specifically because connection strings get pasted into chats and tickets more often than people expect.
Frequently asked questions
Why does my connection string fail to parse?
The most common cause is an unencoded special character in the password or database name — an @ or : inside a password that isn't percent-encoded will be misread as a structural delimiter. Try encoding the password (replacing @ with %40, for example) before pasting.
Does this tool connect to my actual database?
No — it only parses or builds the connection string text itself. No network connection is ever made, and nothing you paste is sent anywhere.
Why isn't my MongoDB replica set connection string supported?
Replica set URIs list multiple comma-separated hosts (mongodb://host1,host2,host3/db), which falls outside standard URI syntax that a single scheme://user:pass@host:port/path parser can handle. Parse one host from the list at a time instead.