Encode / Decode/Query String

Query String

Parse and rebuild URL query strings

Parameters0
No parameters yet. Parse a URL, or add one manually.
Built URL0 chars

Everything after the question mark in a URL is the query string: a list of key and value pairs joined by ampersands, each side percent-encoded. It looks trivial until a value contains an ampersand, a key appears twice, or a framework decides that brackets in a name mean an array — at which point reading one by eye becomes genuinely error-prone.

This tool splits a query string into a table you can actually read, lets you edit the pairs, and rebuilds a correctly encoded string from the result. It is the quickest way to see what a tracking-laden campaign URL is really carrying, to check that a redirect is passing the parameter you think it is, or to strip a URL back to the part that matters before sharing it.

How to use it

  1. Paste a URL or a bare query stringEither works. If you paste a full address, the origin and path are kept separate so you can rebuild the whole URL afterwards.
  2. Read the decoded pairsEach key and value is shown percent-decoded, so an encoded redirect target or a JSON blob in a parameter becomes readable instead of a wall of escapes.
  3. Edit and rebuildChange, add or remove pairs and the encoded string is regenerated with the correct escaping applied to each value rather than to the string as a whole.

Frequently asked questions

What happens when the same key appears more than once?

The URL specification does not say, so it depends entirely on the server. PHP keeps the last occurrence unless the name ends in brackets, Express collects them into an array, and some frameworks take the first. Repeated keys are shown here as separate rows so you can see exactly what is being sent rather than guessing which one wins.

Should a space be encoded as %20 or as a plus sign?

Inside a query string both are decoded as a space, because the form-urlencoded format that browsers use for form submissions defines plus that way. Percent-20 is the safer choice: it is correct everywhere in a URL, whereas a plus sign in a path segment is a literal plus and not a space at all.

How do arrays and nested objects get encoded?

There is no standard. Common conventions are repeating the key, appending empty brackets to the name, or indexing them numerically; nested objects are usually expressed with bracketed paths. Because it is convention rather than specification, the parser on the other end has to agree with the one that built the string.

Is there a length limit on a query string?

Not in the specification, but there is in practice. Servers and proxies cap the whole request line, commonly around 8 KB, and older browsers were stricter still. If you are approaching that, the data probably belongs in a request body rather than a URL.

What is the fragment, and is it part of the query?

The fragment is everything after the hash, and it is not part of the query string — nor is it sent to the server at all. It stays in the browser, which is why single-page routers once used it for navigation and why analytics parameters placed after a hash never reach your logs.

Related tools

  • URL EncoderPercent-encode and decode query strings and paths
  • JSON FormatterValidate, pretty-print and minify
  • Base64Encode or decode Base64, URL-safe variant included
  • SlugifyURL-safe slugs with transliteration
Nothing left this tab. No request was made, no history was written. Encode / Decode · Query String