Query String Builder
Enter key=value pairs (one per line) and get a properly URL-encoded query string ready to append to a URL.
About this tool
Enter key=value pairs (one per line) and get a properly URL-encoded query string ready to append to a URL.
Example
Input: name=Al B\nage=30
Output: ?name=Al+B&age=30
Privacy
This tool runs entirely in your browser. Your data is processed locally and never uploaded to a server.
How to use this tool
- Paste or type one key=value pair per line.
- Use plain text keys and values, and keep one pair on each line.
- Click or wait for the tool to build the encoded query string.
- Copy the result and append it to a URL after the question mark.
Step by step, what happens
- The tool reads each line as a separate key and value pair.
- It splits the line at the first equals sign so the left side becomes the key and the right side becomes the value.
- It URL-encodes reserved characters in the key and value so spaces, ampersands, and other special characters are safe in a query string.
- It joins the encoded pairs with ampersands to produce a ready-to-use query string.
Worked example
Here is a simple example where you want to search for a term and include a page number in the URL.
Input: q=red shoes
page=2
- The tool treats q as the first key and red shoes as its value, then encodes the space.
- It treats page as the second key with the value 2, which needs no special encoding.
Output: q=red%20shoes&page=2
Tips and common mistakes
- Put only one key=value pair on each line, or the tool may treat extra text as part of the value.
- If your value contains an equals sign, check that the tool uses the first equals sign to split the pair.
- Special characters like spaces, ampersands, and question marks should be left unescaped in the input because the tool will encode them for you.
- If you already have a full query string, remove the leading question mark before pasting it here.
Frequently asked questions
What input format?
One key=value per line. The part before the first = is the key.
Are special characters encoded?
Yes, spaces and symbols are percent-encoded so the string is URL-safe.
Does it add the leading ?
Yes, the output starts with ? ready to append to a URL.
More Developer Tools Tools
Explore related calculators in this category
Query String Parser
Parse a URL query string into key-value pairs. Decodes percent-encoding automatically.
Byte Array ⇄ String
Convert a string to a byte array (UTF-8) or a byte array back to a string. Supports decimal byte lists.
Color Shade Generator
Generate a palette of tints and shades from a base hex color. Great for design systems.
GraphQL Query Builder
Wrap a GraphQL query into a valid JSON request body and a cURL command for your endpoint.
You Might Also Like
Popular tools from other categories
Wealth Builder Calculator
See how regular investing compounds into long-term wealth.
1031 Exchange Calculator - Free Online
Free Calculate tax deferral in a 1031 exchange. Step-by-step solutions and formulas included. Fast, accurate, and free, with formula and example.
4% Rule Calculator
Find the retirement nest egg you need using the 4% safe-withdrawal rule.
70% Rule Calculator
Calculate max offer using the 70% rule for flips.
Can't Find the Right Calculator?
Try our AI Math Solver, type any problem in plain English and get instant step-by-step solutions.