What is Query String Builder
The Query String Builder is a client-side tool that constructs URL query strings from key-value pairs. Enter one parameter per line in key=value format (e.g., search=hello, page=2, sort=date), and the tool uses the URLSearchParams API to properly encode each value and assemble the complete query string with correct delimiters. The output is a query string prefixed with ? (e.g., ?search=hello&page=2&sort=date), ready to append to any base URL. The builder handles URL encoding automatically — special characters in values (spaces, ampersands, equals signs) are encoded correctly. This eliminates the manual work of remembering encoding rules and delimiter syntax when constructing URLs for API requests, form actions, or redirect targets.
Why Use Query String Builder
Constructing query strings manually is error-prone — forgetting to URL-encode spaces, using + instead of %20, misplacing delimiters, or accidentally including bare & characters. The Query String Builder automates the encoding and formatting, producing correct query strings every time. This is particularly useful when building API test URLs, constructing OAuth authorization URLs with multiple parameters, generating redirect URLs with callback parameters, and creating shareable links with tracking parameters.
Privacy & Security
This tool runs entirely in your browser — no data ever leaves your device. There is no server round-trip, no upload, no logging, and no account required. Your input is processed locally using client-side JavaScript and is never stored, transmitted, or accessible to anyone else. When you close the tab, everything disappears.
Frequently Asked Questions
What encoding is used?
<p>The tool uses the standard URL encoding via URLSearchParams, which encodes spaces as +, and special characters as %XX. This is the encoding expected by web servers and APIs.</p>Can I include hash fragments?
<p>No. The tool builds query strings only. To include a hash fragment, append it after the query string manually (?param=value#section).</p>Does it handle duplicate keys?
<p>If you enter the same key twice, both values are included in the output as separate parameters (e.g., ?tag=js&tag=react). This is correct behavior for multi-value parameters.</p>How does it handle special characters in values?
<p>The URLSearchParams API automatically encodes special characters: spaces become +, & becomes %26, = becomes %3D. This ensures the resulting query string is syntactically correct and safe to use in URLs.</p>Can I build query strings for POST requests?
<p>Yes. The output is a standard query string that can be used in URL-encoded POST bodies (Content-Type: application/x-www-form-urlencoded) as well as URL query parameters.</p>What if I enter a key without a value?
<p>Lines without = are treated as keys with empty values (e.g., ?debug). The builder includes them in the output, which is correct for boolean-style query parameters.</p>What if I enter malformed lines?
<p>Lines without an = sign are treated as keys with empty values. Lines that are empty or contain only whitespace are ignored. The builder is lenient and produces valid output from imperfect input.</p>Can I use this for OAuth authorization URLs?
<p>Yes. OAuth URLs require multiple parameters (client_id, redirect_uri, scope, state, response_type). Enter each as a key=value line and the builder produces the correctly encoded query string.</p>