Developer tools

Query String Builder

Query String Builder

Turn key/value rows into an encoded query string and back again.

About this tool

About Query String Builder

Writing ?q=red%20shoes&size=9&size=10 by hand is error-prone: one unescaped & or # in a value and the server reads something else. Type parameters as plain key/value rows and the encoded query string appears on the right. It works the other way too: paste a query string, or a whole URL, into the right pane and it is split into decoded rows you can edit. Choose how spaces are written (%20, which suits any URL, or +, which HTML forms use), and how repeated keys become lists: repeated (a=1&a=2, used by most frameworks), brackets (a[]=1&a[]=2, used by PHP and Rails) or comma-joined (a=1,2). You can sort keys, skip empty values, toggle the leading question mark, and add a base URL to get a complete link. Rows can be switched off without deleting them. Encoding follows the URL Standard, the same rules browsers use, and everything happens in your browser.

Built and maintained by Abhi JainUpdated

How to Build a Query String

  1. 1

    Add parameters

    Type keys and values in the Parameters rows, or paste an existing query string or URL into the Query string pane.

  2. 2

    Pick the encoding

    Choose Spaces as %20 or +, how Repeated keys are written, and tick Sort keys, Skip empty values or Leading ? as needed.

  3. 3

    Copy the result

    Copy the query string, or enter a Base URL and click Copy full URL.

Query String Builder: questions and answers

Should spaces be %20 or + in a query string?

Both are understood by almost every server. + comes from HTML form encoding (application/x-www-form-urlencoded); %20 is the general URL encoding and is also safe in paths. If in doubt, use %20.

How do I pass an array in a query string?

There is no single standard. Repeating the key (ids=1&ids=2) works with most frameworks, PHP and Rails expect brackets (ids[]=1&ids[]=2), and some APIs want a comma list (ids=1,2). Check what the server expects and pick the matching style.

Which characters must be encoded in a query value?

Anything outside letters, digits and - _ . ! ~ * ' ( ) should be percent-encoded, and & = # + must be encoded inside values because they have special meaning. The builder does this for you.

What is the maximum length of a query string?

HTTP sets no limit, but browsers, servers and proxies do. About 2,000 characters for the whole URL is the safe ceiling; send larger data in a POST body.

Ready-made Query String Builder presets