Skip to content
T
Tools.Town
Free Online Tools for Everyone
?page=1&sort=asc

Query String Builder

100% Free

Build URL query strings from key-value pairs with proper percent-encoding, or parse and decode any URL's query parameters — instantly in your browser.

Build & Parse
RFC-3986
Encoded Right
100% Client-Side
Mode

1. Key-Value pairs

Encoding style

2. Output

Full URL

https://example.com/api/search?page=1&limit=20&sort=name

Query string

?page=1&limit=20&sort=name

Encoded key-value pairs
KeyValueEncoded keyEncoded value
page1page1
limit20limit20
sortnamesortname

Embed This Tool

Easy to Embed

Add Query String Builder to your website or blog in seconds.

  • Responsive design
  • Lightweight & fast
  • No backend required
  • Always up-to-date
<iframe
  src="https://tools.town/embed/query-string-builder/"
  width="100%"
  height="600"
  style="border:none; border-radius:12px;"
  loading="lazy"
  title="Query String Builder">
</iframe>

Share This Tool

Share Instantly

Share Query String Builder with anyone — no login required.

  • Shareable link
  • No login required
  • Works on any device
  • No account needed

Share via

Advertisement

How to Use

  1. 1 Switch between Build mode (key-value pairs → query string) and Parse mode (URL → decoded pairs)
  2. 2 In Build mode, enter your key-value pairs and an optional base URL
  3. 3 Choose encoding style — RFC-3986 (%20 spaces) or form-urlencoded (+ spaces)
  4. 4 Copy the generated query string or full URL to your clipboard
  5. 5 In Parse mode, paste any URL or query string to see decoded key-value pairs

Features

  • Build mode: compose a query string from key-value pairs with proper RFC-3986 or form-urlencoded encoding
  • Parse mode: decode any URL or query string into a clean key-value table
  • Handles special characters — Unicode, brackets, emoji — with correct percent-encoding
  • Warns about duplicate keys and empty keys
  • Shows encoded key and value side-by-side for debugging
  • 100% client-side — nothing you type is uploaded or stored

Why it Matters

Hand-crafting a query string is error-prone: a single unencoded space or ampersand breaks the URL. This tool encodes every character correctly per RFC-3986, warns about duplicates, and lets you verify exactly what each key-value pair looks like encoded — saving debugging time every time you build an API request or link.

★★★★★

Use Cases

API Development

Build correctly-encoded query strings for REST API requests

URL Debugging

Paste a URL from browser DevTools and decode each parameter

Marketing Links

Compose tracking parameters alongside your UTM tags

Search URL Building

Construct and test search query URLs for your own tools

What this tool does

The Query String Builder has two modes. Build mode takes your key-value pairs, percent-encodes every key and value correctly per RFC-3986, and assembles them into a valid query string (optionally appended to a base URL). Parse mode takes any URL or raw query string and decodes it into a clean, readable key-value table — showing both the raw encoded value and the decoded result side by side.

How percent-encoding works

A query string is the ?key=value&key2=value2 part of a URL. Characters that would break URL parsing — spaces, &, =, #, and any non-ASCII Unicode — must be replaced with % followed by the character’s hexadecimal code point. The tool does this automatically, following RFC-3986 for standard URLs and the application/x-www-form-urlencoded variant (spaces as +) for HTML form compatibility.

When would you need this?

Whenever you’re building an API integration, debugging a broken URL from browser DevTools, constructing a search link programmatically, or passing complex data through URL parameters — any time you need to be certain the encoding is correct and that every parameter is accounted for.

Privacy

Everything runs locally in your browser. Nothing you type is uploaded, logged, or stored.

Frequently Asked Questions

What is percent-encoding (URL encoding)?
Percent-encoding replaces characters that aren't allowed in a URL — such as spaces, &, =, #, or non-ASCII Unicode — with a % followed by their two-digit hexadecimal code point. For example, a space becomes %20 and é becomes %C3%A9. This ensures the URL is always valid and unambiguous.
What's the difference between %20 and + for spaces?
Both encode a space, but in different contexts. RFC-3986 (standard URL encoding) uses %20 in query strings. HTML forms use application/x-www-form-urlencoded encoding, which represents spaces as +. Most web servers accept both, but API clients and modern web frameworks typically prefer %20. The tool lets you choose.
What does 'duplicate key' mean and is it valid?
A duplicate key means the same key name appears more than once in the query string — for example ?id=1&id=2. This is technically valid per the URL spec and some APIs use it to pass arrays. Most server frameworks parse it into a list. The tool warns you so you can decide if it's intentional.
Why do some characters appear unchanged in the output?
RFC-3986 defines a set of 'unreserved characters' — A–Z, a–z, 0–9, -, _, ., ~ — that do not need encoding because they are safe everywhere in a URL. The tool only encodes characters that require it, keeping the output as readable as possible.
Can I use this for building query strings with arrays?
Yes. To pass an array using repeated keys (e.g. ?tag=js&tag=css), simply add two pairs with the same key. The tool will warn about the duplicate but still generate the correct output. Bracket notation (?tag[]=js) is also supported — the brackets are percent-encoded as %5B%5D.
Does this tool make any network requests?
No. Both the builder and the parser run entirely in your browser using JavaScript. Nothing you type is ever sent to a server.

Related Tools You Might Like

Browse more free tools