Query String Builder

Build a URL-encoded query string from key/value rows, with an optional base URL and a form-style plus-for-space toggle.

q=hello%20world&page=1
Result: 4 lines, 39 characters

Key/value pairs into a safe query string

Query String Builder turns a list of key/value pairs into a correctly URL-encoded query string. Type each parameter name and its value into the rows, add or remove rows as needed, and the encoded output updates live below. Spaces, ampersands, equals signs, plus signs, and other reserved characters are escaped with encodeURIComponent so the result is always safe to paste into a link. Add an optional base URL and the tool joins everything with a ?, or a & when the URL already contains parameters. Use it for the parameters of an API call, a search or filter link that carries several options, a tracking link with utm_ parameters, or a form-encoded body to test a POST against — and, in the other direction, to pull apart a long redirect or callback URL and read what it carries. To see a URL split into its protocol, host, port, path and fragment, with the parameters after a # read too, use the URL Parser.

How to use it

Optionally paste a base URL like https://example.com/search. Fill in a key and value on each row, using the Add row button for more parameters and the ✕ button to drop one. Rows with an empty key are skipped automatically, and empty values are kept as key= while Keep empty values is on (the default). When the result looks right, press Copy to put the finished query string (or full URL) on your clipboard. Going the other way, paste a query string or a whole URL into the box under the rows and Decode query / URL into rows splits it back into rows, the URL's own address becoming the base URL. Beside Copy, Copy query only and Copy with ? take the bare query and the ?-prefixed one whether or not a base URL is filled in, and Send the result to the decode box puts the result in that box to edit as text and decode back. A value that is already URL-encoded is named under the result, since each % in it would be encoded again, and Decode them once undoes one layer.

Frequently asked questions

How are special characters handled?

Every key and value is escaped with encodeURIComponent, so spaces become %20, and characters like &, =, +, and # are percent-encoded. Turn on “encode spaces as +” to use the application/x-www-form-urlencoded form style instead, matching what HTML forms and URLSearchParams produce. The output is always a valid query string you can safely paste into a URL.

What happens to empty keys or values?

Rows with an empty key are skipped entirely. A row with a key but an empty value is kept as key= , which is a valid parameter with no value — unless you turn off Keep empty values, which drops it.

What happens with repeated keys, and can I get the pairs as JSON?

Repeated keys chooses how a key that repeats is written: tag=one&tag=two (the default), tag[]=one&tag[]=two, or tag[0]=one&tag[1]=two, and a note under Result names each repeated key in case it happened by accident. As JSON shows the same pairs as an object, a repeated key becoming an array, with its own Copy JSON button.

Can I copy just the query, spot a value that is already encoded, or send the result back to be decoded?

Yes. Beside Copy, which copies what the Result box shows, Copy query only and Copy with ? take the bare query and the ?-prefixed one, built from the rows whether or not a base URL is filled in. A key or value that already holds a percent escape is named under the result — each % in it would be encoded again — and Decode them once undoes one layer, leaving + and a stray % alone. Send the result to the decode box puts the built query or URL into the box under the rows, to edit as text and decode back into rows.