URL / URI Tools

Query string builderKeep every repeated parameter in order

Keep every repeated parameter in order

Query string builder

Input

Your input is processed in this browser and is not sent to a server.

Results

Options

Choose Query, URL or JSON explicitly. Query treats the first # as a fragment; URL mode preserves its original base and hash without opening it.

Object JSON groups repeated values and loses interleaved order and flag distinctions. Integer-like keys can reorder. Choose entries for exact parameters.

Maximum 100,000 UTF-16 input units and 1,000 entries. Generated exports are never truncated. Each output format is limited to 1,200,000 UTF-16 units; exceeding it rejects conversion instead of truncating.

Parameter table

Rows are a draft until applied. A flag without = requires an empty value and a nonempty key. Preview changes to apply or discard them.

Enter input or choose an example to begin.

The Query string builder turns a query, a URL or JSON into editable parameter rows. Inspect URL parameters without losing repeated names, empty values or the difference between flag and flag=.

Use query string to JSON conversion for a test fixture, then choose form or RFC3986 percent encoding when rebuilding the link. Query values remain text, including long identifiers and leading zeros.

Why use this Query string builder?

Preserve the parameter sequence

The Query string builder exports an ordered entries array with key, value and hasEquals. Unlike a grouped object, it preserves interleaved repeated keys and flags without an equals sign.

Three connected pairs become three rows in the same order.

Sort without shuffling duplicates

Preview a stable sort by decoded key before applying it. Equal keys keep their value order; Undo restores the earlier input and results.

Four rows are grouped by key shape while values of repeated keys retain their order.

Read, edit and rebuild

01

Choose the input mode

Select Query, URL or JSON explicitly. Query accepts an optional leading ? and treats the first # as a fragment. URL mode preserves the original base and fragment without opening the address.

02

Confirm the encoding

By default, input + means space and form output writes spaces as +. Choose literal plus for input or RFC3986 output for %20. Automatic conversion waits 350 ms; turn it off to use the button or Ctrl/Cmd + Enter.

03

Review changes before applying

Edit rows, add a parameter, remove a row or preview sorting, then apply the proposed replacement. Copying and downloads stay disabled while results are stale. Undo restores the previous input, settings and result.

One table, several representations

Repeated keys stay separate

The table keeps each parameter as a row. A hasEquals flag distinguishes debug from debug= without converting either to a Boolean.

Two JSON outputs

Ordered entries retain the complete parameter sequence. Grouped object JSON uses strings or string arrays for repeated keys and is convenient when cross-key order is irrelevant.

Encoded query and URL

Rebuild query text or a URL while retaining its base and hash. Names and values are encoded separately, so an & or = inside a value stays data.

Complete exports

Copy the selected output, download text, or save a JSON report. Exported results are complete even when a generated replacement is too large to apply.

Syntax and limits

Explicit query boundaries
Only & separates pairs; empty segments are ignored. Split each pair at its first =. In Query mode the first # starts the fragment; in URL mode a ? after # belongs to the fragment.
Strict text decoding
Malformed percent escapes, invalid UTF-8 and lone surrogates are rejected. Raw C0/DEL control characters are rejected in URL/query input; encoded controls and valid escaped JSON controls are supported.
JSON is a string model
Accept an entries array or an object of strings/string arrays. Reject duplicate object keys, nested values, numbers, Booleans and null. An empty array creates no parameters; integer-like object keys can follow JavaScript property order.
Entries preserve flags
Each entry has key, value and hasEquals. A flag without = must have an empty value and a nonempty key. Use hasEquals=true to represent an empty name, including =. Object export loses flag distinctions and interleaved key order.
Stable sorting and editing
Sorting compares decoded keys by UTF-16 code units, with equal keys stable. Editing a textarea can normalize CRLF; untouched values remain unchanged. Re-encoding can change the original spelling and is not an API signature canonicalizer.
Input and replacement limits
Input is limited to 100,000 UTF-16 code units and 1,000 entries. Generated output is not truncated, but a canonical replacement over 100,000 units cannot be applied. Export it instead. Each output format is limited to 1,200,000 UTF-16 units; exceeding it rejects conversion instead of truncating.

Questions about the Query string builder

What happens to repeated parameters?

Every occurrence stays in its own row. Use entries JSON to preserve the full sequence; object JSON groups repeated values in an array.

Does parameter order matter?

A receiving service may interpret it. The tool preserves it by default and offers an explicit stable sort preview; it does not declare two requests equivalent.

Are nested objects supported?

No. Bracket and dotted names stay literal. JSON object values must be strings or arrays of strings; use entries for exact parameter order.

Should a space be + or %20?

Form output uses +; RFC3986 output uses %20. Input plus interpretation is a separate choice. A literal plus is encoded as %2B.

Will the original URL and fragment survive?

URL mode retains the base and fragment as supplied and never requests the address. JSON entries describe parameters only, so use the URL result or report to retain URL context.

Something looks wrong?

Query string builder

Use the Query string builder with a small example, inspect repeated keys and flags, then copy the representation your application expects.