TOOLGRID
首页图片工具PDF 工具视频工具音频工具
更多
开发工具Web 与 SEO分类文本工具计算器关于
菜单
首页图片工具PDF 工具视频工具音频工具开发工具Web 与 SEO分类文本工具计算器关于
TOOLGRID

需要某项具体功能时,完整工具箱始终可用。

© 2026 TOOLGRID。保留所有权利。

工具

图片工具PDF 工具视频工具音频工具

资源

分类隐私政策

站点

关于条款联系
  1. 首页
  2. Web & SEO Tools
  3. Query String Builder

Query String Builder

Compose URL query strings from key-value rows — repeated keys for arrays, automatic percent-encoding, live preview.

Pasted code or structured data→Query String Builder result浏览器本地处理

Loading tool…

格式与处理方式

工具代码会在浏览器中处理所选文件和输入内容,不会将其提交给 TOOLGRID 的处理接口。

输入
Pasted code or structured data
输出
Query String Builder result
运行引擎
Browser APIs
浏览器内运行这个工具能做什么

Free in-browser query string builder. Add key-value rows, get a fully percent-encoded query string back. Repeated keys produce array-style parameters (tag=a&tag=b). Use it to build API request URLs, deep links, campaign URLs, or any URL with parameters. Tool code does not submit entered values to a TOOLGRID processing endpoint.

Repeated keys are supported natively — add the same key on multiple rows and you get array-style output (?tag=alpha&tag=beta&tag=gamma). This is the standard convention consumed by Express's qs parser, Rails strong parameters, Spring's @RequestParam List<>, and most modern frameworks. No special bracket syntax required.

Encoding uses the browser's built-in URLSearchParams, so values with spaces, ampersands, equals signs, emoji, or full Unicode are escaped correctly. You get the same percent-encoding the browser would produce when serializing a form — trustworthy without round-tripping through DevTools.

代表性任务

这个工具可以完成什么

Build campaign URLs with UTM parameters

Add rows for utm_source, utm_medium, utm_campaign, utm_content, and utm_term. The builder encodes spaces and special characters in campaign names automatically — no more broken Google Analytics attribution from malformed URLs.

Construct API request URLs for testing

When testing a REST or GraphQL endpoint in Postman, curl, or a browser, build the query string here first so every value is properly encoded. Especially useful when one of your filter values contains a comma, slash, or equals sign.

Generate array-style parameters for filters

Faceted search and tag filters typically use repeated-key parameters (?category=books&category=ebooks&category=audio). Add the same key on multiple rows and the builder outputs them in the format Express, Rails, and most backends expect by default.

使用边界

依赖结果前需要检查什么

  • Performance and maximum practical input size depend on browser memory, device speed, and the structure of the input.
  • Review the generated result before replacing or publishing an original file.
MDN Web APIs

如何使用

  1. 1

    Edit the seeded rows or add new rows with the + button. Enter a key and value on each row.

  2. 2

    Watch the preview update live — the percent-encoded query string is shown as you type.

  3. 3

    Copy the generated string and append it to your base URL with a leading ? (or & if you're concatenating to an existing query).

使用场景
Build campaign URLs with UTM parameters

Add rows for utm_source, utm_medium, utm_campaign, utm_content, and utm_term. The builder encodes spaces and special characters in campaign names automatically — no more broken Google Analytics attribution from malformed URLs.

Construct API request URLs for testing

When testing a REST or GraphQL endpoint in Postman, curl, or a browser, build the query string here first so every value is properly encoded. Especially useful when one of your filter values contains a comma, slash, or equals sign.

Generate array-style parameters for filters

Faceted search and tag filters typically use repeated-key parameters (?category=books&category=ebooks&category=audio). Add the same key on multiple rows and the builder outputs them in the format Express, Rails, and most backends expect by default.

Compose mobile app deep links

Deep links of the form myapp://path?source=email&campaign=spring-sale need the same percent-encoding rules as web URLs. Build the query portion here, then append it to your custom scheme prefix.

Round-trip a query string with URL Parser

Build a query here, paste it into our URL Parser to verify Google sees what you intended, edit any rows that need adjustment, and copy the final version. The two tools are designed to be used together.

使用技巧
Repeated keys produce array parameters

Want ?tag=a&tag=b&tag=c? Just add three rows with key=tag and different values. This is the standard format consumed by most backend frameworks. No need for ?tag[]=a&tag[]=b unless your specific framework requires it (some older PHP setups do).

Spaces become + with URLSearchParams

URLSearchParams uses application/x-www-form-urlencoded serialization, so spaces become +. Percent-encoded %20 also decodes to a space, but this tool intentionally reports the browser API's + output.

Empty values produce key=, not just key

A row with a key and an empty value outputs key= (key followed by equals followed by nothing). To omit the parameter entirely, delete the row instead of leaving the value blank. Some APIs treat key= as a falsy value, others as absent — be explicit about your intent.

The hash fragment is not a query parameter

Everything after # is the hash fragment, parsed separately by the browser and never sent to the server. Build your query string here, then append a hash manually if your single-page app needs one (e.g., #!/route/123).

常见问题

Are keys and values automatically URL-encoded?

Yes. Encoding uses the browser's built-in URLSearchParams API. Spaces become +, ampersands become %26, equals signs become %3D, and full Unicode (including emoji) is escaped using UTF-8 percent encoding. The output can be appended as a query string without encoding it again.

Does it handle repeated keys for array-style parameters?

Yes. Add the same key on multiple rows — the builder includes each row's value as a separate parameter in the output (e.g., tag=alpha&tag=beta). This matches what Express's qs parser, Rails strong parameters, and most modern backends consume by default.

Can I parse an existing query string back into rows?

Not in this tool — it's a builder, not a parser. To break a query string apart, use our URL Parser, which decomposes the full URL (protocol, host, path, query, hash) and lists every parameter with auto-labeled UTM and tracking tags. Build here, parse there.

What's the difference between this and the UTM Builder?

This tool is a generic any-parameter builder — keys and values are freeform. The UTM Builder is purpose-built for Google Analytics campaign URLs with named fields (Source, Medium, Campaign, Content, Term) and validation specific to UTM conventions. Use UTM Builder if you only need campaign URLs; use this when you need arbitrary query parameters for APIs, filters, or deep links.

Does the tool support empty values or empty keys?

Empty values output key= (a key followed by an equals sign and nothing). Empty keys are skipped — a row with no key contributes nothing to the output. To remove a parameter, delete the row instead of clearing one of its fields.

Is my data sent to a server?

The URLSearchParams API is built into every modern browser, and the tool runs in your browser. Tool code does not submit entered keys, values, or generated query strings to a TOOLGRID processing endpoint. Review browser extensions and device security before handling sensitive parameters.

Will the output work with my framework's query parser?

For repeated keys (arrays), yes — Express qs, Rails strong parameters, Spring @RequestParam List, ASP.NET model binding, and Go's url.Values all accept the standard ?key=a&key=b format. PHP defaults are an exception: you may need ?key[]=a&key[]=b — type the brackets explicitly in your key field if so.

继续当前流程

下一步常用工具

如果还需要校验、转换或复用结果,可以继续打开相近的浏览器本地工具。

URL 解析器Web 与 SEO · 本地→URL 编码解码转换工具 · 本地→UTM 链接生成器Web 与 SEO · 本地→