?=

URL Query Parser & Builder

Inspect URL parameters or build a URL from key-value pairs

One key=value pair per line. Repeated keys are supported.

URL Query Parser & Builder — what it does

Parse a URL into its query parameters as readable key-value pairs, or build a complete URL from a base address and a list of pairs, with repeated keys supported. It turns the dense tail of a long link into something you can actually read and edit.

Worked example

An order-list link with a repeated key, an encoded space and a fragment, run through Parse URL. The Query parameters box is filled with one key=value per line (shown first) and the output below it lists every key with all of its values; the status line reads 4 parameter(s).

Input — source URL

https://shop.example.com/orders?status=open&status=paid&customer=Ann%20Lee&page=2#top

Output — parameter lines, then the JSON view

status=open
status=paid
customer=Ann Lee
page=2

{
  "status": [
    "open",
    "paid"
  ],
  "customer": [
    "Ann Lee"
  ],
  "page": [
    "2"
  ]
}

%20 is decoded to a space in the parameter list, every key maps to an array even when it occurs once, and the #top fragment is not a parameter so it is ignored.

When this tool helps

  • Reading what a long tracking or campaign URL is actually passing.
  • Building a request URL with several parameters without hand-encoding each one.
  • Editing one parameter in a link without retyping the whole address.

How to use it

  1. Paste the source URL to parse it.
  2. Review the parameters as key-value pairs.
  3. Edit them, or enter your own pairs one per line.
  4. Build the URL and copy the result.

Accuracy, limits, and good practice

  • Repeated keys are legal and meaningful in many APIs, where they represent a list — so do not assume a duplicate is an error.
  • Parameter values are encoded when the URL is built, so you can type spaces and symbols directly into a value.
  • Parameter order rarely matters technically, but keeping it stable makes URLs easier to compare and cache.

Frequently asked questions

What is the fragment after the hash?

It is not part of the query and is never sent to the server; browsers use it for in-page navigation and client-side routing.

How long can a URL be?

There is no formal limit, but many servers and browsers cap it around two thousand characters. Longer data belongs in a request body.

How do I build a campaign link?

The UTM link builder produces properly formed source, medium and campaign parameters for analytics.

How does Build URL encode my values and handle lines without a value?

Each non-empty line is split at its first =; the key is trimmed, the rest is the value, and a line with no = becomes a key with an empty value. Values are encoded the query-string way, so a space becomes + rather than %20. Building from the base above with the lines status=open, customer=Ann Lee, sort=total desc and export gives https://shop.example.com/orders?status=open&customer=Ann+Lee&sort=total+desc&export=.

What happens to the existing query and fragment when I click Build URL?

They are discarded: everything from the first ? onwards is cut from the source URL before the lines in the parameters box are appended, so the #top fragment in the example is lost as well. Only if the source URL has no ? at all is a fragment kept. Parse first, edit the lines, then Build — the parse step writes the current parameters into the box for you.

Related tools on this site

Everything above runs inside this page. URL Query Parser & Builder needs no account, no upload, and no server round trip — close the tab and nothing is left behind.

URL 查詢參數解析與建立能做什麼

把網址解析成可讀的查詢參數鍵值組,或從基底網址與一組鍵值建立完整網址,並支援重複鍵。它把長連結後面那串密密麻麻的字,變成你真的讀得懂、也改得動的內容。

實際範例

一個含重複鍵、已編碼空格與片段識別碼的訂單清單連結,按「解析網址」解析。「參數」方框會填成每行一組 key=value(先顯示),下方則列出每個鍵的全部值;狀態列顯示 4 parameter(s)。

來源:網址

https://shop.example.com/orders?status=open&status=paid&customer=Ann%20Lee&page=2#top

參數列表,接著是 JSON 檢視

status=open
status=paid
customer=Ann Lee
page=2

{
  "status": [
    "open",
    "paid"
  ],
  "customer": [
    "Ann Lee"
  ],
  "page": [
    "2"
  ]
}

參數列表裡 %20 被還原成空格;每個鍵都對應一個陣列,即使只有一個值;#top 片段不是參數,會被忽略。

什麼時候用得上

  • 看清一條長長的追蹤或活動網址究竟傳了什麼。
  • 組出含多個參數的請求網址,不必逐一手動編碼。
  • 只改連結中的一個參數,不必重打整個位址。

使用步驟

  1. 貼上來源網址進行解析。
  2. 檢視鍵值組形式的參數。
  3. 直接編輯,或每行一組輸入自己的鍵值。
  4. 建立網址並複製結果。

精確度、限制與實務建議

  • 重複鍵在許多 API 中是合法且有意義的(代表清單),所以別看到重複就當成錯誤。
  • 建立網址時參數值會自動編碼,因此你可以直接在值裡打空格與符號。
  • 參數順序在技術上多半無關緊要,但保持穩定能讓網址更好比較、也更利於快取。

常見問題

井號後面那段是什麼?

那是片段,不屬於查詢字串,也永遠不會送到伺服器;瀏覽器用它做頁內導覽與前端路由。

網址可以多長?

沒有正式上限,但許多伺服器與瀏覽器約在兩千字元左右設限。更長的資料應放在請求主體中。

怎麼做行銷活動連結?

UTM 連結產生器能產出格式正確的來源、媒介與活動參數,供分析工具使用。

「建立網址」怎麼編碼我的值、怎麼對待沒有值的行?

每個非空白行在第一個 = 處切開;鍵會修剪前後空白,其餘部分是值,沒有 = 的行會成為值為空的鍵。值以參數字串的方式編碼,所以空格變成 + 而不是 %20。以上面的基底網址搭配 status=open、customer=Ann Lee、sort=total desc、export 四行建立,會得到 https://shop.example.com/orders?status=open&customer=Ann+Lee&sort=total+desc&export=。

按「建立網址」時,原本網址上的參數與片段會怎樣?

會被捨棄:來源網址從第一個 ? 起的部分會先被切掉,再接上參數方框裡的各行,所以範例裡的 #top 片段也會一併消失。只有在來源網址完全沒有 ? 時,片段才會保留。建議先解析、修改各行、再建立,解析那一步會替你把目前的參數寫進方框。

本站相關工具

以上步驟全部在這個頁面內完成,URL 查詢參數解析與建立 不需要註冊、不上傳檔案、也不經過伺服器,關閉分頁後不會留下任何資料。