Skip to content
TabBench

Query String Builder

Build a URL query string from name and value rows or a JSON object. Choose array format, space encoding and sorting, then copy the result or code for it.

Runs in your browser. Nothing you add is uploaded.

What the Query String Builder does

Writing a query string by hand goes wrong in familiar ways: a forgotten encoding of & or #, spaces written three different ways, arrays in the wrong format for the backend. Enter your parameters as rows, paste a JSON object or import an existing query string, and this builder encodes everything correctly, lets you choose the array format, and shows the equivalent code for JavaScript, Python, PHP and curl.

How to build a query string

  1. Choose where the parameters come from: rows, a JSON object or an existing query string.
  2. Add each name and value. Repeat a name on several rows to send several values. Switch a row off to leave it out.
  3. Pick the array format your backend expects, how spaces are written, and whether to sort and skip empty values.
  4. Optionally add a base URL to get the complete address.
  5. Copy the query string, the full URL or the code for your language.

The Query String Builder runs entirely in your browser — nothing you enter is uploaded, stored, or logged.

When to use it

Calling a search or filter API

Build a request with several filter values, sort order and paging without worrying about which characters need encoding.

Converting between formats

Import a query string that uses tag=a&tag=b and re-export it as tag[]=a&tag[]=b for a PHP backend.

Generating test URLs

Produce consistent, sorted query strings for tests, cache keys and request signing.

Good to know

  • Encode values, not the whole URL, or the :// and / will be mangled.
  • Sort parameters when you need a stable string for signing or caching.
  • For nested data, bracket syntax such as filter[status]=open is widely understood, but not universal.
  • An empty value (name=) is different from a missing parameter. Use “skip empty values” deliberately.
  • Keep secrets out of query strings.

Frequently asked questions

Which array format should I use?

Whatever your server expects. Repeating the name (tag=a&tag=b) works for most frameworks. PHP and Rails prefer tag[]=a, and some APIs document comma-separated values. Check the API docs.

Should spaces be %20 or +?

%20 is correct everywhere in a URL. + means a space only in form-encoded query strings, and most servers accept both there. When in doubt use %20.

Does it encode the parameter names too?

Yes. Names are encoded like values, except that square brackets in array notation are left readable.

What is the difference between encodeURIComponent and this?

encodeURIComponent leaves ! ' ( ) * unescaped. This builder escapes them too, which matches RFC 3986 and what strict APIs such as OAuth 1.0 signatures require.

Can I build a query string from JSON with nested objects?

Yes. Nested objects become name[key]=value and arrays follow the format you choose, for example filter[tags][]=new.

Why does my value contain + in the JavaScript output?

URLSearchParams always writes spaces as +, which is valid in a query string. If a server insists on %20, build the string with this tool's “%20” option instead.