Testing

URLSearchParams: Browser Support, Methods, Known Issues

URLSearchParams works in Chrome 49+, Edge 17+, Firefox 29+, Opera 36+, Safari 10.1+ on macOS, iOS 10.3+, and Samsung Internet 5+. Learn the methods and quirks.

Author

Prince Dewani

May 6, 2026

URLSearchParams is a JavaScript Web API in the WHATWG URL Standard that parses, reads, edits, and serializes the query string of a URL. It supports Chrome 49+, Edge 17+, Firefox 29+, Opera 36+, Safari 10.1+ on macOS, Safari 10.3+ on iOS, and Samsung Internet 5+, while Internet Explorer never added support.

This guide covers what URLSearchParams is, its browser support, the key methods, common use cases, how to check support at runtime, and the known issues.

What is URLSearchParams?

URLSearchParams is a built-in JavaScript interface defined by the WHATWG URL Standard. It provides utility methods to read, edit, append, and delete the key-value pairs in the query string of a URL. The interface is iterable, so the entries also work in for...of loops and the spread operator.

Which browsers does URLSearchParams support?

URLSearchParams works in every modern browser. Chrome, Firefox, Safari, Edge, Opera, and Samsung Internet all ship it by default, while Internet Explorer never added support.

Loading browser compatibility data...

URLSearchParams compatibility in Chrome

Chrome supports URLSearchParams from Chrome 49 on Windows, macOS, Linux, ChromeOS, and Android. Chrome 1 to 48 did not include the interface, so any visitor on those very old builds needs a polyfill. The newer URLSearchParams.size property requires Chrome 113 or later.

URLSearchParams compatibility in Edge

Microsoft Edge supports URLSearchParams from Edge 17 on Windows on the legacy EdgeHTML engine, and by default from Edge 79 on the Chromium engine across Windows, macOS, and Linux. Edge 12 to 16 did not include URLSearchParams. The size property requires Edge 113 or later.

URLSearchParams compatibility in Firefox

Firefox first added URLSearchParams in Firefox 29 with partial support, and full default support from Firefox 44 on Windows, macOS, Linux, and Android. Firefox 1 to 28 did not include URLSearchParams. The size property requires Firefox 116 or later.

URLSearchParams compatibility in Safari

Safari supports URLSearchParams from Safari 10.1 on macOS Sierra and later. Safari on iOS and iPadOS supports it from iOS 10.3. Older Safari and iOS versions did not include URLSearchParams. The size property requires Safari 17 on macOS and iOS.

URLSearchParams compatibility in Opera

Opera supports URLSearchParams from Opera 36 on Windows, macOS, and Linux. Opera Mobile supports it from Opera Mobile 36 on Android. Opera 9 to 35 did not include the interface. The size property requires Opera 99 or later.

URLSearchParams compatibility in Samsung Internet

Samsung Internet supports URLSearchParams from Samsung Internet 5.0 on Galaxy phones and tablets. It is built on Chromium, so it inherits the full URLSearchParams API and matches Chrome for Android. The size property arrives with the Chromium 113 base, so Samsung Internet 22 and later expose it.

URLSearchParams compatibility in Android Browser

Chrome for Android supports URLSearchParams from Chrome for Android 49 on Android 4.4 and later. The legacy stock Android Browser on Android 4.3 and earlier did not add URLSearchParams. Modern Android phones should rely on Chrome for Android, Firefox for Android, or Samsung Internet for full support.

URLSearchParams compatibility in Internet Explorer

Internet Explorer never added URLSearchParams. IE 5.5 to 11 do not provide the interface, so any code that calls new URLSearchParams throws a ReferenceError. Sites that still need IE coverage should ship a polyfill such as url-search-params-polyfill, or fall back to manual querystring parsing with String.prototype.split.

Note

Note: URLSearchParams behavior breaks across older Safari, iOS, and Internet Explorer builds. Test it on real browsers and OS with TestMu AI. Try TestMu AI free!

What are the key methods of URLSearchParams?

URLSearchParams ships twelve instance methods plus a size property. They cover reading, writing, iterating, and serializing the key-value pairs of a query string.

  • append(name, value): Adds a new key-value pair at the end without removing duplicates.
  • delete(name): Removes every entry that matches the given key.
  • get(name): Returns the first value tied to a key, or null if the key is missing.
  • getAll(name): Returns every value tied to a key as a string array.
  • has(name): Returns true if any entry with the key exists.
  • set(name, value): Replaces every existing entry that matches the key with one new value.
  • sort(): Reorders all entries alphabetically by key, in stable order.
  • toString(): Returns the serialized query string, ready to drop into a URL.
  • entries(), keys(), values(): Return iterators over the entries, keys, or values of the params.
  • forEach(callback): Runs a callback for every entry, in insertion order.
  • size: A read-only number that counts entries. Available in Chrome 113+, Edge 113+, Firefox 116+, Opera 99+, and Safari 17+.

What are the common use cases of URLSearchParams?

Developers reach for URLSearchParams whenever a URL carries data. The most common patterns are reading filters from the address bar, building a clean query string for fetch, and updating the URL without a full page reload.

  • Reading query parameters from window.location.search: Pass window.location.search straight into the constructor to parse all current params with no manual splitting.
  • Building POST request bodies for fetch: Pair URLSearchParams with fetch to send application/x-www-form-urlencoded data, with no manual encoder needed.
  • Updating the URL with history.replaceState: Mutate a URLSearchParams object and call history.replaceState to keep the new state in the address bar without a navigation.
  • Working with the URL constructor: Every URL object exposes a live searchParams property; assign through it to mutate the underlying URL in one place.
  • Sharing filter state across users: Encode dashboard filters into a query string so users can copy a link that reproduces the same view.
  • Iterating params in a loop: A for...of loop over the URLSearchParams object yields each [key, value] pair in insertion order.

How do you check if a browser supports URLSearchParams?

Run a single feature check in JavaScript or use the DevTools console. The interface is exposed as a global, so a typeof check confirms support in seconds.

  • Open DevTools: Press F12 or right-click the page and choose Inspect, then switch to the Console tab.
  • Check the global: Type typeof URLSearchParams and press Enter. If the console logs the string function, the browser supports the interface.
  • Confirm a method works: Run new URLSearchParams("a=1&b=2").get("a"). A return value of 1 confirms the constructor and get method both work.
  • Test the size property: Run new URLSearchParams("a=1&b=2").size. A return value of 2 confirms the modern size property; undefined means the browser is older than Chrome 113, Firefox 116, or Safari 17.
  • Save a reusable snippet: Paste the feature-detection block below into the console so you can run the same check on every browser in your support matrix.

Paste this snippet into the browser DevTools console to confirm URLSearchParams support and the newer size property:

// Run in any browser DevTools console.
const supportsUSP = typeof URLSearchParams === "function";
const supportsSize = supportsUSP && "size" in new URLSearchParams();

console.log("URLSearchParams supported:", supportsUSP);
console.log("URLSearchParams.size supported:", supportsSize);

if (supportsUSP) {
    const params = new URLSearchParams("q=test&page=2");
    console.log("q value:", params.get("q"));
    console.log("entry count:", supportsSize ? params.size : [...params].length);
} else {
    console.log("Load a polyfill before parsing query strings.");
}

If supportsUSP logs false, the page should load a polyfill before any code calls new URLSearchParams. If supportsSize logs false, count entries with Array.from(params).length instead of params.size.

...

What are the known issues with URLSearchParams?

URLSearchParams has solid support across modern browsers, but a few real edge cases still trip up production code. The biggest hits are Internet Explorer, the plus-sign decoding rule, and the late-arriving size property.

  • Internet Explorer never added it: IE 5.5 to 11 do not provide URLSearchParams. Use core-js or url-search-params-polyfill for any IE traffic, or migrate users to Edge.
  • The plus sign is decoded as a space: URLSearchParams follows the application/x-www-form-urlencoded rule, so a literal + in the query becomes a space when read back. To send a literal plus, encode it as %2B before building the URL.
  • The size property is recent: URLSearchParams.size ships from Chrome 113, Edge 113, Firefox 116, Opera 99, and Safari 17. On older browsers, count entries with Array.from(params).length or [...params].length.
  • iOS Safari 10.3 plus-sign bug: Early Safari iOS 10.3 builds parsed + differently from spec, encoding it twice on round-trips through URLSearchParams.toString. Modern iOS 15+ is fully compliant.
  • No support for nested objects or arrays: URLSearchParams flattens every value to a string, so a nested object coerces to [object Object]. Serialize complex state with JSON.stringify before passing it to the constructor.
  • new URLSearchParams(undefined) differs across runtimes: Older Node.js builds threw a TypeError on this call, while browsers always returned an empty params object. Pass an explicit empty string for predictable behavior across runtimes.
  • Axios sends URLSearchParams as a JSON body in old Safari 13: Safari 13 had a known fetch and XHR bug where a URLSearchParams body was serialized incorrectly. Build the form body with new FormData or set the Content-Type header by hand on those targets.

In my experience, the most common bug is the plus sign showing up as a space. A user search for c++ tutorials arrives at the server as c tutorials, and the team spends an afternoon hunting before realizing the form should encode + as %2B before building the URLSearchParams object.

...

Citations

All URLSearchParams version numbers and platform notes in this guide come from these primary sources:

Author

Prince Dewani is a Community Contributor at TestMu AI, where he manages content strategies around software testing, QA, and test automation. He is certified in Selenium, Cypress, Playwright, Appium, Automation Testing, and KaneAI. Prince has also presented academic research at the international conference PBCON-01. He further specializes in on-page SEO, bridging marketing with core testing technologies. On LinkedIn, he is followed by 4,300+ QA engineers, developers, DevOps experts, tech leaders, and AI-focused practitioners in the global testing community.

Open in ChatGPT Icon

Open in ChatGPT

Open in Claude Icon

Open in Claude

Open in Perplexity Icon

Open in Perplexity

Open in Grok Icon

Open in Grok

Open in Gemini AI Icon

Open in Gemini AI

Copied to Clipboard!
...

3000+ Browsers. One Platform.

See exactly how your site performs everywhere.

Try it free
...

Write Tests in Plain English with KaneAI

Create, debug, and evolve tests using natural language.

Try for free

Frequently asked questions

Did you find this page helpful?

More Related Hubs

TestMu AI forEnterprise

Get access to solutions built on Enterprise
grade security, privacy, & compliance

  • Advanced access controls
  • Advanced data retention rules
  • Advanced Local Testing
  • Premium Support options
  • Early access to beta features
  • Private Slack Channel
  • Unlimited Manual Accessibility DevTools Tests