ToolHub

Query String Parser

Parse and build URL query strings

Query string parser4 parameters

Decoded parameters

KeyValue
qhello world
page2
tagsa,b
langen

Edit and rebuild

Parameters are parsed with the browser URLSearchParams API, so keys and values are decoded and re-encoded correctly. Everything runs in your browser.

Overview

Parse and rebuild URL query strings instantly

A query string is the part of a URL after the question mark. It carries key and value pairs separated by ampersands, like ?q=hello&page=2&sort=new. Servers, analytics tools, and single page apps read these parameters to decide what to show. The format looks simple, but encoding rules around spaces, plus signs, and reserved characters trip people up constantly.

ToolHub Query String Parser takes a raw query string or a full URL and breaks it into a clean table of decoded keys and values. You can then edit, add, or remove parameters and the tool rebuilds a correctly URL-encoded query string for you. Everything happens in your browser.

Step-by-step

How to parse a query string

  1. 1

    Paste a query string or URL

    Drop in a bare query string (with or without the leading question mark) or an entire URL. The tool finds the query portion automatically.
  2. 2

    Read the decoded parameters

    Every key and value is decoded and shown in a table, so you can see exactly what the URL is carrying without manual unescaping.
  3. 3

    Edit and rebuild

    Change a value, add a new row, or remove one. The rebuilt query string updates live and is encoded correctly. Click copy to grab it.

Background

How query string encoding works

A query string is a series of key=value pairs joined by &. Because URLs have a limited safe character set, any character outside that set has to be percent-encoded. A space becomes %20 (or sometimes a plus sign), an ampersand inside a value becomes %26, and non-ASCII characters are encoded as their UTF-8 bytes.

Why the same key can appear twice

Query strings allow repeated keys, such as ?tag=react&tag=nextjs. This is how HTML forms submit multiple checkbox values. Our parser preserves every occurrence as its own row rather than silently collapsing duplicates.

Plus signs versus percent-twenty

In the query component, a literal space is often written as a plus sign, a holdover from form encoding. A real plus sign in a value must be written as %2B. Mixing these up is a classic source of bugs. The browser URLSearchParams API used here handles both consistently.

Use cases

When to use a query string parser

Debugging tracking links

Inspect UTM parameters and other analytics tags to confirm a campaign URL is built correctly.

Reading API request URLs

Decode the filters, page numbers, and tokens in a long API URL copied from your browser network tab.

Editing parameters by hand

Tweak a single value, like changing page=2 to page=3, then copy the rebuilt URL without re-encoding by hand.

Building share links

Assemble a query string from scratch with proper encoding for spaces and special characters.

Comparing two URLs

Lay out the parameters of a working and a broken URL side by side to spot the difference.

Learning encoding rules

See exactly how spaces, ampersands, and Unicode characters get percent-encoded in real time.

Tips and best practices

  • Always encode values, not the whole URL. Encoding the equals signs and ampersands that separate pairs will break the query string.
  • A leading question mark is optional in the input. The parser strips it for you.
  • Repeated keys are valid. Servers and frameworks differ on whether they read the first, the last, or all values.
  • A plus sign in a decoded value means a literal space. If you need an actual plus, the encoded form is %2B.
  • Fragments after a hash are not part of the query string and are ignored during parsing.

Common questions

Can I paste a full URL or only the query part?

Either works. If you paste a full URL, the tool extracts just the query portion after the question mark. If you paste a bare query string, it parses that directly. A leading question mark is optional.

What happens to duplicate keys?

Each duplicate is kept as a separate row, preserving order. When you rebuild, every row is included, so a key that appears twice in the input appears twice in the output.

Why did my plus sign turn into a space?

In a query string, an unencoded plus sign traditionally represents a space. The decoder follows that rule. If your value truly contained a plus character, it should have been encoded as %2B in the original URL.

Is the output safe to paste into a URL?

Yes. The rebuilt string is produced by URLSearchParams, which percent-encodes keys and values as needed, so it is ready to append after a question mark.

100% private

Privacy and security

Parsing and rebuilding happen locally with the browser URLSearchParams and URL APIs. Your URLs and parameters are never sent over the network.

Related tools

Frequently asked questions

Is the URL processed privately?

Yes. Parsing and rebuilding happen entirely in your browser using the URLSearchParams API. Nothing is uploaded.

Does it decode encoded values?

Yes. Percent-encoded values like %20 are shown decoded in the table, and re-encoded correctly when you rebuild the string.

Can I edit the parameters?

Yes. Edit, add, or remove key-value rows and the output query string updates instantly.