DevTools Logo

Query Param Merge & Diff

Query Param Merge & Diff

Compare two URLs, merge their query parameters, and rebuild the link with encoding you control.

Runs in your browser
Try an example

URLs to compare

A: 0 params · B: 0 params

Base: query only · Path: — · Fragment: none

Base: query only · Path: — · Fragment: none

Parameter diff

0 added · 0 removed · 0 changed

Paste two URLs to see added, removed and changed parameters.

Merge & rebuild

0 params · 0 re-encoded
Merge mode
Conflict policy
Output base
Space encoding

Paste one or two URLs to start

Diffs and rebuilds update live. Nothing is uploaded or stored.

Variant builder

Examples

Staging versus production

Input
A: staging.example.com/app?api=v1&debug=1&tag=a&tag=b · B: prod.example.com/app?api=v2&env=prod&tag=a&tag=c
Output
added env=prod · removed debug=1 · changed api=v1→v2, tag=a&b→a&c; merged URL uses the selected base.

The overlapping tag=a is recognized as unchanged even though the tag key as a whole changed.

UTM campaign variants

Input
Base: https://shop.example.com/p?utm_medium=email&ref=home · vary utm_source with email, paid social, newsletter
Output
Three URLs: utm_source=email, utm_source=paid%20social, utm_source=newsletter.

Only the varied parameter is encoded; all other pairs are copied verbatim.

Encoded input stays encoded

Input
https://a.example/p?a=%7E&b=b%2Bc&c=coffee+tea (raw mode)
Output
https://a.example/p?a=%7E&b=b%2Bc&c=coffee+tea

Choosing re-encoding with %20 and form-mode decoding would instead emit a=~&b=b+c&c=coffee%20tea.

About this tool

Query Param Merge & Diff is a two-URL workbench for comparing and rebuilding query strings. Paste a staging and a production URL to see which parameters were added, removed or changed, then merge the two sets with an explicit conflict policy. The table shows decoded values next to their raw encoded forms so an innocent-looking change such as a plus sign becoming %20 is visible before you copy the result.

The underlying model keeps ordered [key, value] pairs rather than flattening parameters into an object. Duplicate keys are preserved, empty values stay distinct from bare keys, key case is never changed, and the URL fragment is kept with the chosen base (or stripped deliberately). Untouched pairs are emitted byte-for-byte by default, so a rebuilt signed link does not quietly fail because the tool decided to normalize an escape.

Per-key overrides and include toggles resolve conflicts without editing text: choose A, B, both or exclude for any row. The variant builder turns one parameter into a list of rebuilt URLs, and a curl command or HAR snippet can be pasted as an input source. Everything runs locally in the browser tab — pasted URLs are not fetched, uploaded or persisted.

What this tool does not do

  • This tool manipulates query parameters only; it does not resolve relative URLs, normalize hosts or rewrite paths.
  • Diff comparison is multiset-based on decoded values: two keys with identical value counts are unchanged even if the raw spellings differ.
  • Empty query segments (&&) are skipped and therefore are not reproduced on rebuild; a warning reports how many were dropped.
  • Signed-URL detection is a heuristic based on signature parameter names; generic tokens and expiry fields do not trigger it, and its absence is not proof that a URL is unsigned.
  • Re-encoding uses minimal RFC 3986 encoding of unreserved characters only; application-specific characters such as | or : are escaped.
  • URLs are processed in the browser tab and are never fetched, uploaded or persisted.

How to use this tool

  1. Paste two URLs

    Put the source URL in A and the URL to compare in B. A bare query string such as utm_source=email&api=v1 works too, as does a curl command or a HAR snippet via the import field.

  2. Read the diff

    The table groups rows as added, removed or changed. Duplicate keys get per-value detail: a shared value is marked unchanged while the differing values are marked removed or added.

  3. Choose a merge policy

    Union with A wins, B wins or keep-both; or restrict the output to A-only or B-only. Use the per-key override select to make one exception without changing the global policy.

  4. Toggle and encode

    Uncheck a row's Include box to drop its pairs. Keep Raw encoding for byte-safe output, or choose %20 / + re-encoding when you deliberately want normalized values.

  5. Copy or build variants

    Switch the output between full URL, query-only string and Markdown link, then copy it. The variant builder produces one URL per value of a chosen parameter, with Copy all for the whole list.

Use cases

Compare environment links

See exactly which query parameters differ between staging and production without eyeballing two long URLs.

Build UTM variants

Turn one campaign parameter into a list of links for email, social and paid channels in a single pass.

Construct QA URLs

Merge feature flags and debug switches into a test link while dropping parameters that should not ship.

Audit encoded links

Inspect raw and decoded forms side by side to catch double encoding, literal plus signs or broken percent escapes.

Merge and encoding options

OptionBehavior
Union · A winsAll A pairs in their original order, followed by keys that exist only in B in B order.
Union · B winsAll B pairs in their original order, followed by keys that exist only in A in A order.
Union · keep bothA pairs then B pairs for shared keys (duplicates appended); B-only keys follow.
A-only / B-onlyOne side's pairs only; per-key overrides still apply to keys present on both sides.
Raw (byte-safe)Default. Every untouched pair keeps its exact original encoding, including non-minimal escapes and bare keys.
Re-encode %20 / +Decode with the selected plus-mode, then emit minimal RFC 3986 encoding with %20 or + for spaces; keys keep their case.
Full URL / query / MarkdownOutput as base + query + fragment, just the query string, or [Link](url) for documentation and changelogs.

Diff comparison always uses percent-decoded values with + treated as a literal plus, so flipping the display toggle never changes which rows are reported as changed.

Common mistakes

Mistake:Treating ?tag=a&tag=b as a single tag parameter.

Fix:Use keep-both or per-key overrides; the tool preserves both occurrences rather than collapsing them into one value.

Mistake:Re-encoding a signed URL and wondering why it stopped working.

Fix:Stay in Raw mode for untouched signed links, and heed the signature warning — reordering or changing escape casing can invalidate the signature.

Mistake:Assuming + and %20 are interchangeable everywhere.

Fix:They mean the same thing only in form-encoded query data. Use the plus-mode toggle deliberately and check the raw column.

Mistake:Expecting the fragment to be part of the diff.

Fix:Fragments are preserved from the selected base and can be stripped with Keep fragment off; they are never treated as query parameters.

Mistake:Pasting a URL with a trailing newline.

Fix:Leading and trailing whitespace is trimmed automatically, so the last parameter value is not corrupted by a copy/paste artifact.

Frequently asked questions

Are duplicate query keys preserved?

Yes. Parameters are stored as ordered key/value pairs, not as an object. A URL like ?tag=a&tag=b keeps both pairs, in the same order, through diff, merge and rebuild. Choose the keep-both policy when both URLs contain the same key and you want both sets of values in the output.

What is the difference between + and %20?

In application/x-www-form-urlencoded query data, + is conventionally decoded as a space; in strict RFC 3986 parsing it is a literal plus sign. This tool shows both the raw form and the decoded form, and lets you choose + or %20 when re-encoding. Diff comparison always treats + as a literal plus so the result does not change when you flip the display toggle.

Does merging change parameter order?

Only according to the documented policy. With A wins, A's pairs keep their original order and keys found only in B are appended in B order. With B wins the same happens starting from B. Keep both emits A's pairs first and appends B's pairs for shared keys. Key case is never changed.

Can I diff staging and production URLs?

That is the main use case. Paste one URL into A and the other into B to get added, removed and changed parameter rows. The tool also warns when the bases differ and lets you select which base the rebuilt URL should use, so you can verify the query against either environment.

What happens to the URL fragment (#)?

The fragment is not treated as a parameter and never appears in the diff. It is preserved from whichever base (A or B) you selected for the output, and you can strip it with the Keep fragment checkbox when you need a canonical link.

Why might a rebuilt signed URL stop working?

Signatures often cover the exact byte sequence and order of the query string. Re-encoding an escape, sorting keys or changing + to %20 can invalidate it. The tool warns when it detects signature parameters and defaults to Raw mode, which emits untouched pairs byte-for-byte. Treat the warning as a prompt to review, not as a guarantee of validity.

Are my pasted URLs uploaded or saved?

No. Parsing, diffing, merging and variant generation all happen locally in the browser tab. Nothing is fetched from the URLs you paste, and no URL text is persisted; this matters because query strings frequently contain tokens and signatures.

References & standards