toolqik

68 · API & Webhooks

Query String Builder

Build correctly encoded query strings from key=value lines or JSON.

Runs in your browser
Encoding
Repeated keys
Options
Query string

  
Full URL

  

About this tool

Concatenating strings to build URLs breaks as soon as a value contains &, =, #, a space or a non-English character. This builder percent-encodes every key and value correctly, supports the array conventions different backends expect, and previews the full URL. Enter one key=value per line, or paste a JSON object; nested objects become bracket keys like filter[brand].

Array formats

FormatExampleUsed by
Repeatsize=9&size=10Go, Python, Java, URLSearchParams.getAll
Bracketssize[]=9&size[]=10PHP, Rails, Node qs
Commasize=9,10Many REST APIs and OpenAPI’s default form style without explode
Indexsize[0]=9&size[1]=10Some PHP and .NET model binders

In code

// JavaScript
const url = new URL('https://shop.example.com/search');
url.searchParams.set('q', 'running shoes & socks');
url.searchParams.append('size', '9');
url.toString(); // …?q=running+shoes+%26+socks&size=9

# Python
from urllib.parse import urlencode
urlencode({"q": "running shoes & socks", "size": [9, 10]}, doseq=True)

FAQ

How do I build a query string?

Enter one key=value pair per line (or paste JSON) above. Each key and value is encoded and joined with &, and the full URL is shown below.

How do I pass an array in a query string?

It depends on your server: repeated keys (a=1&a=2) are most widely understood; PHP and Rails expect a[]=1&a[]=2. Pick the format above.

Should spaces be + or %20?

Both are decoded as spaces in query strings by almost all servers. + is the HTML form convention; %20 is the general URL encoding.

esc
↑↓ navigate↵ open