Query string builder
Build an encoded query string, on its own or onto a URL you already have.
Optional. Leave it empty to build just the query string.
Values are percent-encoded for you.
Test it
Fill the form to build a link.
URL
Before you ship this
- Note: Add a parameter name and value.
How to use it
- Add a name and value for each parameter.
- Optionally add a base URL — existing parameters on it are kept.
- Values are encoded for you, including spaces and ampersands.
- Copy the result.
Encoding is not optional
An ampersand inside a value ends that value and starts a new parameter. An equals sign splits it. A hash discards everything after it. All three happen with ordinary text like "tea & coffee".
This builder encodes values with the same rules a server uses to decode them, so what you put in is what the application reads out.
Spaces: %20, not plus
Both decode to a space in a query string, but only %20 means a space everywhere else. Using it consistently means the same encoded value works in a path, a header or a redirect without a second thought.
Keep names boring
A parameter name containing a space, a plus or a percent sign has to be encoded too, and every tool that touches the URL afterwards becomes a place it can go wrong.
Lowercase letters, digits and underscores cost nothing and never surprise anyone.
Repeated keys are where backends disagree
There is no standard for sending a list. Rails and PHP expecttags[]=a&tags[]=b, Express and Go read a plain repeatedtags=a&tags=b, and some APIs want one comma-joined value. All three are legal query strings, and the wrong one silently arrives as a single string or an empty array rather than an error.
Check what the receiving end parses before you build the link, not after the integration returns nothing.
Query string builder FAQ
Do I need to encode query string values?
Yes, whenever a value may contain a space, an ampersand, an equals sign, a hash or a non-ASCII character. An unencoded ampersand ends the value early and the rest of it becomes a parameter of its own.
Can a query string have the same parameter twice?
It is legal, and some frameworks read it as an array. But no standard defines which value wins when it is read as a single value, so relying on it is a bug waiting for a framework upgrade.
How long can a URL be?
There is no limit in the specification, but around 2,000 characters something in the chain — a browser, a proxy, a server log — starts truncating. Past that, the data belongs in a POST body.
Does the order of parameters matter?
Not to a server reading them, but it matters elsewhere. Caches, analytics tools and canonical comparisons often treat two orderings as two different URLs, so a page linked with the parameters in varying orders fragments its own data. Pick an order and generate it consistently.
Should the data go in the query string or the fragment?
The fragment — everything after the hash — is never sent to the server, so it is the right place for state that only the page itself uses, such as an open tab or a scroll target. Anything the server or your analytics needs has to be in the query string.
Can I put an email address or an order number in a query string?
Avoid it. URLs end up in server logs, browser history, analytics reports and the referrer header sent to third-party scripts. A link emailed to a customer with their address in the query string has leaked it to every vendor on the destination page.
What do extra parameters do to analytics?
They split one page into many. Every distinct combination becomes its own row, so a page with three optional parameters can appear a dozen times in a report. Most analytics tools let you strip known parameters at ingestion, and it is worth configuring before the data is a year deep.
Will parameter URLs cause duplicate content?
They can, where the parameter does not change the content — tracking tags, session identifiers, sort orders that return the same items. A self-referencing canonical pointing at the clean URL resolves it, which is more reliable than trying to block the parameters from being crawled.
What characters are safe in parameter names?
Letters, digits, hyphens and underscores. Avoid spaces, dots and brackets: they are technically encodable but several frameworks interpret them as structure, turning a name with brackets into an array and a name with a dot into a nested object.
When should a value be a path segment instead?
When it identifies the resource rather than modifying it. A product identifier belongs in the path, a sort order belongs in the query. Paths are the thing people link to and search engines prefer to index; query strings are for options on top of them.