Skip to content
OddsockLocal
Local
Source text

The preview shows up here.

ReadyRuns in this browser. Nothing is uploaded.

How to use

  1. Paste a JSON object. Values may be strings, numbers or arrays.
  2. Use an array when one key should appear more than once.
  3. Read the ? string. Spaces are +, and reserved characters are percent-encoded.
  4. Paste that string into the parser if you want the values decoded again.

What is Query string builder?

Query strings are awkward once a value contains a space, a slash or a second copy of the same key. This page takes a JSON object and writes the ? string with URLSearchParams rules. {"q":["a b","a/b"],"page":1} becomes ?q=a+b&q=a%2Fb&page=1. The space is a plus, the slash is %2F, and the key q appears twice because the value was an array.

Read more

That plus sign is the detail people argue about. application/x-www-form-urlencoded uses + for space. encodeURIComponent uses %20. The builder follows the form rules, which is what servers usually expect on a query string. The parser page reads the same string back, and a+b becomes the value a b again.

The input has to be a JSON object, not an array and not a bare URL. Numbers and booleans are written as text. There is no row editor hiding behind the box: the object is the rows.

Use cases

  • A search URL needs q twice, once with a space and once with a slash, and you want both encodings visible.
  • A test fixture should show page=1 next to the repeated q without hand-encoding each value.
  • You are checking that a space became + and not %20, because the server splits on form encoding.
  • A teammate pasted a JSON body and you only need the query portion of a GET.

A repeated key, a space and a slash

{"q":["a b","a/b"],"page":1}

?q=a+b&q=a%2Fb&page=1

Why use Oddsock

Plus for space is the form-encoding rule. If you needed %20 for a path segment, the URL encoder is the other page.

Related tools

Using this tool

The builder uses URLSearchParams, which follows form encoding. a b becomes a+b. The URL encoder page uses encodeURIComponent, so the same space becomes %20.