๐งฉ Query String Builder
https://example.com/search?q=hello+world&page=2
Enter a base URL and key-value pairs, and this tool automatically builds a properly URL-encoded query string. Values containing spaces or special characters are encoded automatically. Handy for building test URLs for an API, or creating links with tracking parameters.
How to use
- Enter the base URL.
- Add as many key-value parameter pairs as you need.
- The finished, URL-encoded URL is generated automatically โ use "Copy" to copy it.
How the calculation works
Enter a few keyโvalue pairs and this tool assembles the query string (the part after "?") and the full URL. Keys and values are encoded in application/x-www-form-urlencoded format with the browser's URLSearchParams: spaces become "+", and non-ASCII characters and symbols such as "&" and "=" become percent-encoded sequences like %E6%97%A5. Pairs are joined with "&". If the base URL already contains "?", the new pairs are joined with "&" instead of a second "?". If it has a #fragment, the query is inserted before it. Rows with an empty key are ignored.
Worked example
Base URL: https://example.com/search q = hello world page = 2 โ https://example.com/search?q=hello+world&page=2 Base URL: https://example.com/search?lang=ja โ https://example.com/search?lang=ja&q=hello+world&page=2 Base URL: https://example.com/page#top โ https://example.com/page?q=hello+world&page=2#top A value of "ๆฅๆฌ่ช" becomes %E6%97%A5%E6%9C%AC%E8%AA%9E.
Things to be aware of
- Almost all web servers and frameworks read "+" in a query string as a space. A literal "+" is encoded as %2B.
- Repeating a key outputs it repeatedly (tag=a&tag=b). Whether it is read as an array depends on the server.
- URLs have practical length limits (thousands to tens of thousands of characters depending on browser and server); send large data with POST.
FAQ
Is it okay to include spaces or non-English text in a value?
Yes, entered values are automatically percent-encoded, so spaces, non-Latin characters, and symbols all produce a correct query string.
Can I use the same key multiple times?
Yes, add multiple rows with the same key name to build array-style query parameters, like "?tag=a&tag=b".
What happens to a row with an empty key?
Rows with an empty key are ignored and excluded from the query string.