Query Parameter Without Equals – Why ?debug Becomes an Empty String

Local only

Explain URLSearchParams behavior for key-only query segments without an equals sign.

15 chars · 1 line

34 chars · 4 lines

2 parameters2 unique keys

Flag-style query parameter

Why does ?debug parse as an empty string?

A key-only query segment is accepted by URLSearchParams. With no explicit equals sign or value, the exposed value is the empty string. This tool is free to use. No account or payment is required.

Last updated

What you can do here

  • Browser-native URLSearchParams behavior
  • Full URL and raw query parsing
  • Repeated parameter preservation
  • JSON object to query construction
  • Browser-local processing

Steps

  1. Paste the flag-style query into Parse to JSON.
  2. Check whether the receiving application interprets key presence as true.
  3. Use an explicit value such as debug=true when that contract is clearer.

URLSearchParams stores strings, not implicit booleans

The parser does not infer true merely because a key is present. A segment named debug without = produces an empty-string value.

If your API uses presence-only flags, handle that rule at the application layer rather than expecting generic query parsing to create a boolean.

Flag parameter without equals

debug exists but its parsed value is empty.

Query string

?debug&name=ada

Parsed JSON

{
  "debug": "",
  "name": "ada"
}

Common questions

Frequently asked questions

Does ?debug mean true?

Not to URLSearchParams. It means the key debug exists with an empty-string value.

Will debug=false become a boolean false?

No. Query parsing returns strings; application code decides how to interpret them.

Is ?debug equivalent to ?debug=?

For URLSearchParams value retrieval, both expose an empty string.

Debugging a specific Query String issue? Browse Query String troubleshooting.