← All tools

Tested guide

How to read duplicate URL query parameters without losing values

Repeated names, empty values and key-only flags in a concrete parsing example.

By URNPC · Published and tested October 1, 2026

URLSearchParams preserves repeated name–value pairs when you iterate over entries. get(name) returns the first value; getAll(name) returns all matching values. Converting the pairs directly into a plain object can lose duplicates. Server frameworks may apply different rules.

The experiment

Measured examples · 2026-10-01
Input URLDecoded parameter pairs
https://example.com/?tag=red&tag=blue&empty=&flag[["tag","red"],["tag","blue"],["empty",""],["flag",""]]

Computed from the published fixtures using Node.js 22.22.2, ICU 78.2, Unicode 17.0. Run the same examples in your browser.

Keep the ordered pairs

The example has tag=red followed by tag=blue. Our inspector displays both rows in their original order. This lets you see the input that a first-value, last-value or multi-value receiver would handle differently.

Avoid Object.fromEntries when repeated values matter: the resulting object has only one property for each name. Group values into arrays or keep an ordered list of pairs, depending on the receiving API. The URL standard does not determine how every server framework binds query parameters.

Empty values and key-only flags

Both empty= and flag produce an empty string value in the parsed pair list. The original query string remains available in the inspector if you need to distinguish their spelling. Do not infer that an empty flag means true without checking the application contract.

Parameter order and spelling can matter to a signing or caching system even when an application treats the values as equivalent. Keep the original URL for those workflows. The inspector parses for understanding; it does not promise byte-for-byte round trips.

Inspect without opening the destination

The inspector constructs a local URL object. It does not fetch the pasted address, resolve its host or verify that the destination exists. It accepts complete HTTP or HTTPS addresses and rejects embedded usernames or passwords.

Tokens and personal data can appear in query parameters or fragments. Remove them before sharing a screenshot. A successful parse only confirms that the browser can interpret the URL; it is not a safety or reputation check.

Standards and references

These results describe the tested implementations and inputs. Report a reproducible discrepancy through our contact page.

Continue exploring