URL

Baseline Widely available *

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

* Some parts of this feature may have varying levels of support.

Note: This feature is available in Web Workers.

The URL interface is used to parse, construct, normalize, and encode URLs. It works by providing properties which allow you to easily read and modify the components of a URL.

You normally create a new URL object by specifying the URL as a string when calling its constructor, or by providing a relative URL and a base URL. You can then easily read the parsed components of the URL or make changes to the URL.

Constructor

URL()

Creates and returns a URL object from a URL string and optional base URL string. Throws if the passed arguments don't define a valid URL.

Instance properties

hash

A string containing a '#' followed by the fragment identifier of the URL.

host

A string containing the domain (that is the hostname) followed by (if a port was specified) a ':' and the port of the URL.

hostname

A string containing the domain of the URL.

href

A stringifier that returns a string containing the whole URL.

origin Read only

Returns a string containing the origin of the URL, that is its scheme, its domain and its port.

password

A string containing the password specified before the domain name.

pathname

A string containing an initial '/' followed by the path of the URL, not including the query string or fragment.

port

A string containing the port number of the URL.

protocol

A string containing the protocol scheme of the URL, including the final ':'.

A string indicating the URL's parameter string; if any parameters are provided, this string includes all of them, beginning with the leading ? character.

searchParams Read only

A URLSearchParams object which can be used to access the individual query parameters found in search.

username

A string containing the username specified before the domain name.

Static methods

canParse()

Returns a boolean indicating whether or not a URL defined from a URL string and optional base URL string is parsable and valid.

createObjectURL()

Returns a string containing a unique blob URL, that is a URL with blob: as its scheme, followed by an opaque string uniquely identifying the object in the browser.

parse()

Creates and returns a URL object from a URL string and optional base URL string, or returns null if the passed parameters define an invalid URL.

revokeObjectURL()

Revokes an object URL previously created using URL.createObjectURL().

Instance methods

toString()

Returns a string containing the whole URL. It is a synonym for URL.href, though it can't be used to modify the value.

toJSON()

Returns a string containing the whole URL. It returns the same string as the href property.

Usage notes

The constructor takes a url parameter, and an optional base parameter to use as a base if the url parameter is a relative URL:

js
const url = new URL("../cats", "http://www.example.com/dogs");
console.log(url.hostname); // "www.example.com"
console.log(url.pathname); // "/cats"

The constructor will raise an exception if the URL cannot be parsed to a valid URL. You can either call the above code in a try...catch block or use the canParse() static method to first check the URL is valid:

js
if (URL.canParse("../cats", "http://www.example.com/dogs")) {
  const url = new URL("../cats", "http://www.example.com/dogs");
  console.log(url.hostname); // "www.example.com"
  console.log(url.pathname); // "/cats"
} else {
  console.log("Invalid URL");
}

URL properties can be set to construct the URL:

js
url.hash = "tabby";
console.log(url.href); // "http://www.example.com/cats#tabby"

URLs are encoded according to the rules found in RFC 3986. For instance:

js
url.pathname = "démonstration.html";
console.log(url.href); // "http://www.example.com/d%C3%A9monstration.html"

The URLSearchParams interface can be used to build and manipulate the URL query string.

To get the search params from the current window's URL, you can do this:

js
// https://some.site/?id=123
const parsedUrl = new URL(window.location.href);
console.log(parsedUrl.searchParams.get("id")); // "123"

The toString() method of URL just returns the value of the href property, so the constructor can be used to normalize and encode a URL directly.

js
const response = await fetch(
  new URL("http://www.example.com/démonstration.html"),
);

Specifications

Specification
URL
# url

Browser compatibility

desktop mobile server
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Bun
Deno
Node.js
URL
Chrome – Full support
Chrome 19 (Release date: 2012-05-15)
prefix
prefix Implemented with the vendor prefix: webkit
Chrome – Full support
Chrome 32 (Release date: 2014-01-14)
footnote Full support
Edge – Full support
Edge 12 (Release date: 2015-07-29)
footnote Full support
Firefox – Full support
Firefox 19 (Release date: 2013-02-19)
footnote
footnote Before version 57, Firefox had a bug whereby single quotes contained in URLs are escaped when accessed via URL APIs (see bug 1386683).
Opera – Full support
Opera 15 (Release date: 2013-07-02)
prefix
prefix Implemented with the vendor prefix: webkit
Opera – Full support
Opera 19 (Release date: 2014-01-28)
footnote Full support
Safari – Full support
Safari 6 (Release date: 2012-07-25)
prefix
prefix Implemented with the vendor prefix: webkit
Safari – Full support
Safari 7 (Release date: 2013-10-22)
footnote Full support
Chrome Android – Full support
Chrome Android 25 (Release date: 2013-02-27)
prefix
prefix Implemented with the vendor prefix: webkit
Chrome Android – Full support
Chrome Android 32 (Release date: 2014-01-15)
footnote Full support
Firefox for Android – Full support
Firefox for Android 19 (Release date: 2013-02-19)
footnote
footnote Before version 57, Firefox for Android had a bug whereby single quotes contained in URLs are escaped when accessed via URL APIs (see bug 1386683).
Opera Android – Full support
Opera Android 14 (Release date: 2013-05-21)
prefix
prefix Implemented with the vendor prefix: webkit
Opera Android – Full support
Opera Android 19 (Release date: 2014-01-28)
footnote Full support
Safari on iOS – Full support
Safari on iOS 6 (Release date: 2012-09-10)
prefix
prefix Implemented with the vendor prefix: webkit
Safari on iOS – Full support
Safari on iOS 7 (Release date: 2013-09-18)
footnote Full support
Samsung Internet – Full support
Samsung Internet 1.5 (Release date: 2013-09-25)
prefix
prefix Implemented with the vendor prefix: webkit
Samsung Internet – Full support
Samsung Internet 2 (Release date: 2014-10-17)
footnote Full support
WebView Android – Full support
WebView Android 4 (Release date: 2011-10-18)
prefix
prefix Implemented with the vendor prefix: webkit
WebView Android – Full support
WebView Android 4.4 (Release date: 2013-12-09)
footnote Full support
WebView on iOS – Full support
WebView on iOS 6 (Release date: 2012-09-10)
prefix
prefix Implemented with the vendor prefix: webkit
WebView on iOS – Full support
WebView on iOS 7 (Release date: 2013-09-18)
footnote Full support
Bun – Full support
Bun 1 (Release date: 2023-09-08)
footnote Full support
Deno – Full support
Deno 1 (Release date: 2020-05-13)
footnote Full support
Node.js – Partial support
Node.js 6.13 – 9.3 (Release date: 2018-02-13)
footnote Partial support
footnote Available as a part of the url module.
Node.js – Full support
Node.js 10 (Release date: 2018-04-24)
footnote Full support
URL() constructor
Chrome – Full support
Chrome 19 (Release date: 2012-05-15)
footnote Full support
Edge – Full support
Edge 12 (Release date: 2015-07-29)
footnote
footnote Before Edge 79, query arguments in the base URL argument are removed when calling the URL constructor.
Firefox – Full support
Firefox 26 (Release date: 2013-12-10)
footnote
footnote Before version 122, host, hostname, and port were not parsed for unknown protocols/schemes.
Opera – Full support
Opera 15 (Release date: 2013-07-02)
footnote Full support
Safari – Partial support
Safari 6 – 14 (Release date: 2012-07-25)
footnote Partial support
footnote Before Safari 14.1, calling the URL constructor with a base URL whose value is undefined caused Safari to throw a TypeError, see bug 216841.
Safari – Full support
Safari 14.1 (Release date: 2021-04-26)
footnote Full support
Chrome Android – Full support
Chrome Android 25 (Release date: 2013-02-27)
footnote Full support
Firefox for Android – Full support
Firefox for Android 26 (Release date: 2013-12-10)
footnote
footnote Before version 122, host, hostname, and port were not parsed for unknown protocols/schemes.
Opera Android – Full support
Opera Android 14 (Release date: 2013-05-21)
footnote Full support
Safari on iOS – Partial support
Safari on iOS 6 – 14 (Release date: 2012-09-10)
footnote Partial support
footnote Before Safari on iOS 14.1, calling the URL constructor with a base URL whose value is undefined caused Safari on iOS to throw a TypeError, see bug 216841.
Safari on iOS – Full support
Safari on iOS 14.5 (Release date: 2021-04-26)
footnote Full support
Samsung Internet – Full support
Samsung Internet 1.5 (Release date: 2013-09-25)
footnote Full support
WebView Android – Full support
WebView Android 4.4 (Release date: 2013-12-09)
footnote Full support
WebView on iOS – Partial support
WebView on iOS 6 – 14 (Release date: 2012-09-10)
footnote Partial support
footnote Before WebView on iOS 14.1, calling the URL constructor with a base URL whose value is undefined caused WebView on iOS to throw a TypeError, see bug 216841.
WebView on iOS – Full support
WebView on iOS 14.5 (Release date: 2021-04-26)
footnote Full support
Bun – Full support
Bun 1 (Release date: 2023-09-08)
footnote Full support
Deno – Full support
Deno 1 (Release date: 2020-05-13)
footnote Full support
Node.js – Full support
Node.js 6.13 (Release date: 2018-02-13)
footnote Full support
canParse() static method
Chrome – Full support
Chrome 120 (Release date: 2023-12-05)
footnote Full support
Edge – Full support
Edge 120 (Release date: 2023-12-07)
footnote Full support
Firefox – Full support
Firefox 115 (Release date: 2023-07-04)
footnote Full support
Opera – Full support
Opera 106 (Release date: 2023-12-19)
footnote Full support
Safari – Full support
Safari 17 (Release date: 2023-09-18)
footnote Full support
Chrome Android – Full support
Chrome Android 120 (Release date: 2023-12-05)
footnote Full support
Firefox for Android – Full support
Firefox for Android 115 (Release date: 2023-07-04)
footnote Full support
Opera Android – Full support
Opera Android 80 (Release date: 2024-01-25)
footnote Full support
Safari on iOS – Full support
Safari on iOS 17 (Release date: 2023-09-18)
footnote Full support
Samsung Internet – Full support
Samsung Internet 25 (Release date: 2024-04-24)
footnote Full support
WebView Android – Full support
WebView Android 120 (Release date: 2023-12-05)
footnote Full support
WebView on iOS – Full support
WebView on iOS 17 (Release date: 2023-09-18)
footnote Full support
Bun – Full support
Bun 1.0.2 (Release date: 2023-09-15)
footnote Full support
Deno – Full support
Deno 1.33 (Release date: 2023-04-28)
footnote Full support
Node.js – No support
Node.js 18.17 – 18.20 (Release date: 2023-07-18)
footnote Removed in 19 and later
Node.js – Full support
Node.js 19.9 (Release date: 2023-04-12)
footnote Full support
createObjectURL() static method
Chrome – Full support
Chrome 19 (Release date: 2012-05-15)
footnote Full support
Edge – Full support
Edge 12 (Release date: 2015-07-29)
footnote Full support
Firefox – Full support
Firefox 19 (Release date: 2013-02-19)
footnote
footnote createObjectURL() is no longer available within the context of a ServiceWorker.
Opera – Full support
Opera 15 (Release date: 2013-07-02)
footnote Full support
Safari – Full support
Safari 6 (Release date: 2012-07-25)
footnote Full support
Chrome Android – Full support
Chrome Android 25 (Release date: 2013-02-27)
footnote Full support
Firefox for Android – Full support
Firefox for Android 19 (Release date: 2013-02-19)
footnote
footnote createObjectURL() is no longer available within the context of a ServiceWorker.
Opera Android – Full support
Opera Android 14 (Release date: 2013-05-21)
footnote Full support
Safari on iOS – Full support
Safari on iOS 6 (Release date: 2012-09-10)
footnote Full support
Samsung Internet – Full support
Samsung Internet 1.5 (Release date: 2013-09-25)
footnote Full support
WebView Android – Full support
WebView Android 4.4 (Release date: 2013-12-09)
footnote Full support
WebView on iOS – Full support
WebView on iOS 6 (Release date: 2012-09-10)
footnote Full support
Bun – Full support
Bun 1 (Release date: 2023-09-08)
footnote Full support
Deno – Full support
Deno 1.9 (Release date: 2021-04-13)
footnote Full support
Node.js – Full support
Node.js 16.7 (Release date: 2021-08-17)
footnote Full support
hash
Chrome – Full support
Chrome 32 (Release date: 2014-01-14)
footnote Full support
Edge – Full support
Edge 13 (Release date: 2015-11-12)
footnote Full support
Firefox – Full support
Firefox 22 (Release date: 2013-06-25)
footnote Full support
Opera – Full support
Opera 19 (Release date: 2014-01-28)
footnote Full support
Safari – Full support
Safari 7 (Release date: 2013-10-22)
footnote Full support
Chrome Android – Full support
Chrome Android 32 (Release date: 2014-01-15)
footnote Full support
Firefox for Android – Full support
Firefox for Android 22 (Release date: 2013-06-25)
footnote Full support
Opera Android – Full support
Opera Android 19 (Release date: 2014-01-28)
footnote Full support
Safari on iOS – Full support
Safari on iOS 7 (Release date: 2013-09-18)
footnote Full support
Samsung Internet – Full support
Samsung Internet 2 (Release date: 2014-10-17)
footnote Full support
WebView Android – Full support
WebView Android 4.4.3 (Release date: 2014-06-02)
footnote Full support
WebView on iOS – Full support
WebView on iOS 7 (Release date: 2013-09-18)
footnote Full support
Bun – Full support
Bun 1 (Release date: 2023-09-08)
footnote Full support
Deno – Full support
Deno 1 (Release date: 2020-05-13)
footnote Full support
Node.js – Full support
Node.js 6.13 (Release date: 2018-02-13)
footnote Full support
host
Chrome – Full support
Chrome 32 (Release date: 2014-01-14)
footnote Full support
Edge – Full support
Edge 13 (Release date: 2015-11-12)
footnote Full support
Firefox – Full support
Firefox 22 (Release date: 2013-06-25)
footnote Full support
Opera – Full support
Opera 19 (Release date: 2014-01-28)
footnote Full support
Safari – Full support
Safari 7 (Release date: 2013-10-22)
footnote Full support
Chrome Android – Full support
Chrome Android 32 (Release date: 2014-01-15)
footnote Full support
Firefox for Android – Full support
Firefox for Android 22 (Release date: 2013-06-25)
footnote Full support
Opera Android – Full support
Opera Android 19 (Release date: 2014-01-28)
footnote Full support
Safari on iOS – Full support
Safari on iOS 7 (Release date: 2013-09-18)
footnote Full support
Samsung Internet – Full support
Samsung Internet 2 (Release date: 2014-10-17)
footnote Full support
WebView Android – Full support
WebView Android 4.4.3 (Release date: 2014-06-02)
footnote Full support
WebView on iOS – Full support
WebView on iOS 7 (Release date: 2013-09-18)
footnote Full support
Bun – Full support
Bun 1 (Release date: 2023-09-08)
footnote Full support
Deno – Full support
Deno 1 (Release date: 2020-05-13)
footnote Full support
Node.js – Full support
Node.js 6.13 (Release date: 2018-02-13)
footnote Full support
hostname
Chrome – Full support
Chrome 32 (Release date: 2014-01-14)
footnote Full support
Edge – Full support
Edge 13 (Release date: 2015-11-12)
footnote Full support
Firefox – Full support
Firefox 22 (Release date: 2013-06-25)
footnote Full support
Opera – Full support
Opera 19 (Release date: 2014-01-28)
footnote Full support
Safari – Full support
Safari 10 (Release date: 2016-09-20)
footnote Full support
Chrome Android – Full support
Chrome Android 32 (Release date: 2014-01-15)
footnote Full support
Firefox for Android – Full support
Firefox for Android 22 (Release date: 2013-06-25)
footnote Full support
Opera Android – Full support
Opera Android 19 (Release date: 2014-01-28)
footnote Full support
Safari on iOS – Full support
Safari on iOS 10 (Release date: 2016-09-13)
footnote Full support
Samsung Internet – Full support
Samsung Internet 2 (Release date: 2014-10-17)
footnote Full support
WebView Android – Full support
WebView Android 4.4.3 (Release date: 2014-06-02)
footnote Full support
WebView on iOS – Full support
WebView on iOS 10 (Release date: 2016-09-13)
footnote Full support
Bun – Full support
Bun 1 (Release date: 2023-09-08)
footnote Full support
Deno – Full support
Deno 1 (Release date: 2020-05-13)
footnote Full support
Node.js – Full support
Node.js 6.13 (Release date: 2018-02-13)
footnote Full support
href
Chrome – Full support
Chrome 32 (Release date: 2014-01-14)
footnote Full support
Edge – Full support
Edge 13 (Release date: 2015-11-12)
footnote Full support
Firefox – Full support
Firefox 22 (Release date: 2013-06-25)
footnote Full support
Opera – Full support
Opera 19 (Release date: 2014-01-28)
footnote Full support
Safari – Full support
Safari 10 (Release date: 2016-09-20)
footnote Full support
Chrome Android – Full support
Chrome Android 32 (Release date: 2014-01-15)
footnote Full support
Firefox for Android – Full support
Firefox for Android 22 (Release date: 2013-06-25)
footnote Full support
Opera Android – Full support
Opera Android 19 (Release date: 2014-01-28)
footnote Full support
Safari on iOS – Full support
Safari on iOS 10 (Release date: 2016-09-13)
footnote Full support
Samsung Internet – Full support
Samsung Internet 2 (Release date: 2014-10-17)
footnote Full support
WebView Android – Full support
WebView Android 4.4.3 (Release date: 2014-06-02)
footnote Full support
WebView on iOS – Full support
WebView on iOS 10 (Release date: 2016-09-13)
footnote Full support
Bun – Full support
Bun 1 (Release date: 2023-09-08)
footnote Full support
Deno – Full support
Deno 1 (Release date: 2020-05-13)
footnote Full support
Node.js – Full support
Node.js 6.13 (Release date: 2018-02-13)
footnote Full support
origin
Chrome – Full support
Chrome 32 (Release date: 2014-01-14)
footnote Full support
Edge – Full support
Edge 12 (Release date: 2015-07-29)
footnote Full support
Firefox – Full support
Firefox 26 (Release date: 2013-12-10)
footnote
footnote Before Firefox 49, Results for URL using the blob scheme incorrectly returned null.
Opera – Full support
Opera 19 (Release date: 2014-01-28)
footnote Full support
Safari – Full support
Safari 10 (Release date: 2016-09-20)
footnote Full support
Chrome Android – Full support
Chrome Android 32 (Release date: 2014-01-15)
footnote Full support
Firefox for Android – Full support
Firefox for Android 26 (Release date: 2013-12-10)
footnote
footnote Before Firefox for Android 49, Results for URL using the blob scheme incorrectly returned null.
Opera Android – Full support
Opera Android 19 (Release date: 2014-01-28)
footnote Full support
Safari on iOS – Full support
Safari on iOS 10 (Release date: 2016-09-13)
footnote Full support
Samsung Internet – Full support
Samsung Internet 6 (Release date: 2017-08-23)
footnote Full support
WebView Android – Full support
WebView Android 4.4.3 (Release date: 2014-06-02)
footnote Full support
WebView on iOS – Full support
WebView on iOS 10 (Release date: 2016-09-13)
footnote Full support
Bun – Full support
Bun 1 (Release date: 2023-09-08)
footnote Full support
Deno – Full support
Deno 1 (Release date: 2020-05-13)
footnote Full support
Node.js – Full support
Node.js 6.13 (Release date: 2018-02-13)
footnote Full support
parse() static method
Chrome – Full support
Chrome 126 (Release date: 2024-06-11)
footnote Full support
Edge – Full support
Edge 126 (Release date: 2024-06-13)
footnote Full support
Firefox – Full support
Firefox 126 (Release date: 2024-05-14)
footnote Full support
Opera – Full support
Opera 112 (Release date: 2024-07-11)
footnote Full support
Safari – Full support
Safari 18 (Release date: 2024-09-16)
footnote Full support
Chrome Android – Full support
Chrome Android 126 (Release date: 2024-06-11)
footnote Full support
Firefox for Android – Full support
Firefox for Android 126 (Release date: 2024-05-14)
footnote Full support
Opera Android – Full support
Opera Android 83 (Release date: 2024-06-25)
footnote Full support
Safari on iOS – Full support
Safari on iOS 18 (Release date: 2024-09-16)
footnote Full support
Samsung Internet – Full support
Samsung Internet 28 (Release date: 2025-04-02)
footnote Full support
WebView Android – Full support
WebView Android 126 (Release date: 2024-06-11)
footnote Full support
WebView on iOS – Full support
WebView on iOS 18 (Release date: 2024-09-16)
footnote Full support
Bun – Full support
Bun 1.1.4 (Release date: 2024-04-16)
footnote Full support
Deno – Full support
Deno 1.43 (Release date: 2024-05-01)
footnote Full support
Node.js – Full support
Node.js 22.1 (Release date: 2024-05-02)
footnote Full support
password
Chrome – Full support
Chrome 32 (Release date: 2014-01-14)
footnote Full support
Edge – Full support
Edge 12 (Release date: 2015-07-29)
footnote Full support
Firefox – Full support
Firefox 26 (Release date: 2013-12-10)
footnote Full support
Opera – Full support
Opera 19 (Release date: 2014-01-28)
footnote Full support
Safari – Full support
Safari 10 (Release date: 2016-09-20)
footnote Full support
Chrome Android – Full support
Chrome Android 32 (Release date: 2014-01-15)
footnote Full support
Firefox for Android – Full support
Firefox for Android 26 (Release date: 2013-12-10)
footnote Full support
Opera Android – Full support
Opera Android 19 (Release date: 2014-01-28)
footnote Full support
Safari on iOS – Full support
Safari on iOS 10 (Release date: 2016-09-13)
footnote Full support
Samsung Internet – Full support
Samsung Internet 6 (Release date: 2017-08-23)
footnote Full support
WebView Android – Full support
WebView Android 4.4.3 (Release date: 2014-06-02)
footnote Full support
WebView on iOS – Full support
WebView on iOS 10 (Release date: 2016-09-13)
footnote Full support
Bun – Full support
Bun 1 (Release date: 2023-09-08)
footnote Full support
Deno – Full support
Deno 1 (Release date: 2020-05-13)
footnote Full support
Node.js – Full support
Node.js 6.13 (Release date: 2018-02-13)
footnote Full support
pathname
Chrome – Full support
Chrome 32 (Release date: 2014-01-14)
footnote Full support
Edge – Full support
Edge 13 (Release date: 2015-11-12)
footnote Full support
Firefox – Full support
Firefox 22 (Release date: 2013-06-25)
footnote
footnote Before Firefox 53, pathname and search returned wrong values for custom protocols. Given protocol:host/x?a=true&b=false, pathname would return "/x?a=true&b=false" and search would return "", rather than "/x" and "?a=true&b=false" respectively. See bug 1310483.
Opera – Full support
Opera 19 (Release date: 2014-01-28)
footnote Full support
Safari – Full support
Safari 10 (Release date: 2016-09-20)
footnote Full support
Chrome Android – Full support
Chrome Android 32 (Release date: 2014-01-15)
footnote Full support
Firefox for Android – Full support
Firefox for Android 22 (Release date: 2013-06-25)
footnote
footnote Before Firefox for Android 53, pathname and search returned wrong values for custom protocols. Given protocol:host/x?a=true&b=false, pathname would return "/x?a=true&b=false" and search would return "", rather than "/x" and "?a=true&b=false" respectively. See bug 1310483.
Opera Android – Full support
Opera Android 19 (Release date: 2014-01-28)
footnote Full support
Safari on iOS – Full support
Safari on iOS 10 (Release date: 2016-09-13)
footnote Full support
Samsung Internet – Full support
Samsung Internet 2 (Release date: 2014-10-17)
footnote Full support
WebView Android – Full support
WebView Android 4.4.3 (Release date: 2014-06-02)
footnote Full support
WebView on iOS – Full support
WebView on iOS 10 (Release date: 2016-09-13)
footnote Full support
Bun – Full support
Bun 1 (Release date: 2023-09-08)
footnote Full support
Deno – Full support
Deno 1 (Release date: 2020-05-13)
footnote Full support
Node.js – Full support
Node.js 6.13 (Release date: 2018-02-13)
footnote Full support
Percent-encodes trailing space in opaque path with query or fragment
Experimental
Chrome – No support
Chrome
footnote
footnote See bug 40251904
Edge – No support
Edge
footnote
footnote See bug 40251904
Firefox – No support
Firefox
footnote
footnote See bug 1951963
Opera – No support
Opera
footnote
footnote See bug 40251904
Safari – Preview support
Safari TP
footnote Preview browser support
Chrome Android – No support
Chrome Android
footnote
footnote See bug 40251904
Firefox for Android – No support
Firefox for Android
footnote
footnote See bug 1951963
Opera Android – No support
Opera Android
footnote
footnote See bug 40251904
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – No support
Samsung Internet
footnote
footnote See bug 40251904
WebView Android – No support
WebView Android
footnote
footnote See bug 40251904
WebView on iOS – No support
WebView on iOS
footnote No support
Bun – No support
Bun
footnote No support
Deno – No support
Deno
footnote No support
Node.js – No support
Node.js
footnote No support
port
Chrome – Full support
Chrome 32 (Release date: 2014-01-14)
footnote Full support
Edge – Full support
Edge 13 (Release date: 2015-11-12)
footnote Full support
Firefox – Full support
Firefox 22 (Release date: 2013-06-25)
footnote Full support
Opera – Full support
Opera 19 (Release date: 2014-01-28)
footnote Full support
Safari – Full support
Safari 10 (Release date: 2016-09-20)
footnote Full support
Chrome Android – Full support
Chrome Android 32 (Release date: 2014-01-15)
footnote Full support
Firefox for Android – Full support
Firefox for Android 22 (Release date: 2013-06-25)
footnote Full support
Opera Android – Full support
Opera Android 19 (Release date: 2014-01-28)
footnote Full support
Safari on iOS – Full support
Safari on iOS 10 (Release date: 2016-09-13)
footnote Full support
Samsung Internet – Full support
Samsung Internet 2 (Release date: 2014-10-17)
footnote Full support
WebView Android – Full support
WebView Android 4.4.3 (Release date: 2014-06-02)
footnote Full support
WebView on iOS – Full support
WebView on iOS 10 (Release date: 2016-09-13)
footnote Full support
Bun – Full support
Bun 1 (Release date: 2023-09-08)
footnote Full support
Deno – Full support
Deno 1 (Release date: 2020-05-13)
footnote Full support
Node.js – Full support
Node.js 6.13 (Release date: 2018-02-13)
footnote Full support
protocol
Chrome – Full support
Chrome 32 (Release date: 2014-01-14)
footnote Full support
Edge – Full support
Edge 13 (Release date: 2015-11-12)
footnote Full support
Firefox – Full support
Firefox 22 (Release date: 2013-06-25)
footnote Full support
Opera – Full support
Opera 19 (Release date: 2014-01-28)
footnote Full support
Safari – Full support
Safari 10 (Release date: 2016-09-20)
footnote Full support
Chrome Android – Full support
Chrome Android 32 (Release date: 2014-01-15)
footnote Full support
Firefox for Android – Full support
Firefox for Android 22 (Release date: 2013-06-25)
footnote Full support
Opera Android – Full support
Opera Android 19 (Release date: 2014-01-28)
footnote Full support
Safari on iOS – Full support
Safari on iOS 10 (Release date: 2016-09-13)
footnote Full support
Samsung Internet – Full support
Samsung Internet 2 (Release date: 2014-10-17)
footnote Full support
WebView Android – Full support
WebView Android 4.4.3 (Release date: 2014-06-02)
footnote Full support
WebView on iOS – Full support
WebView on iOS 10 (Release date: 2016-09-13)
footnote Full support
Bun – Full support
Bun 1 (Release date: 2023-09-08)
footnote Full support
Deno – Full support
Deno 1 (Release date: 2020-05-13)
footnote Full support
Node.js – Full support
Node.js 6.13 (Release date: 2018-02-13)
footnote Full support
revokeObjectURL() static method
Chrome – Full support
Chrome 19 (Release date: 2012-05-15)
footnote Full support
Edge – Full support
Edge 12 (Release date: 2015-07-29)
footnote Full support
Firefox – Full support
Firefox 19 (Release date: 2013-02-19)
footnote
footnote revokeObjectURL() is no longer available within the context of a ServiceWorker.
Opera – Full support
Opera 15 (Release date: 2013-07-02)
footnote Full support
Safari – Full support
Safari 6 (Release date: 2012-07-25)
footnote Full support
Chrome Android – Full support
Chrome Android 25 (Release date: 2013-02-27)
footnote Full support
Firefox for Android – Full support
Firefox for Android 19 (Release date: 2013-02-19)
footnote
footnote revokeObjectURL() is no longer available within the context of a ServiceWorker.
Opera Android – Full support
Opera Android 14 (Release date: 2013-05-21)
footnote Full support
Safari on iOS – Full support
Safari on iOS 6 (Release date: 2012-09-10)
footnote Full support
Samsung Internet – Full support
Samsung Internet 1.5 (Release date: 2013-09-25)
footnote Full support
WebView Android – Full support
WebView Android 4.4 (Release date: 2013-12-09)
footnote Full support
WebView on iOS – Full support
WebView on iOS 6 (Release date: 2012-09-10)
footnote Full support
Bun – Full support
Bun 1 (Release date: 2023-09-08)
footnote Full support
Deno – Full support
Deno 1.9 (Release date: 2021-04-13)
footnote Full support
Node.js – Full support
Node.js 16.7 (Release date: 2021-08-17)
footnote Full support
search
Chrome – Full support
Chrome 32 (Release date: 2014-01-14)
footnote Full support
Edge – Full support
Edge 13 (Release date: 2015-11-12)
footnote Full support
Firefox – Full support
Firefox 22 (Release date: 2013-06-25)
footnote
footnote Before Firefox 53, pathname and search returned wrong values for custom protocols. Given protocol:host/x?a=true&b=false, pathname would return "/x?a=true&b=false" and search would return "", rather than "/x" and "?a=true&b=false" respectively. See bug 1310483.
Opera – Full support
Opera 19 (Release date: 2014-01-28)
footnote Full support
Safari – Full support
Safari 10 (Release date: 2016-09-20)
footnote Full support
Chrome Android – Full support
Chrome Android 32 (Release date: 2014-01-15)
footnote Full support
Firefox for Android – Full support
Firefox for Android 22 (Release date: 2013-06-25)
footnote
footnote Before Firefox for Android 53, pathname and search returned wrong values for custom protocols. Given protocol:host/x?a=true&b=false, pathname would return "/x?a=true&b=false" and search would return "", rather than "/x" and "?a=true&b=false" respectively. See bug 1310483.
Opera Android – Full support
Opera Android 19 (Release date: 2014-01-28)
footnote Full support
Safari on iOS – Full support
Safari on iOS 10 (Release date: 2016-09-13)
footnote Full support
Samsung Internet – Full support
Samsung Internet 2 (Release date: 2014-10-17)
footnote Full support
WebView Android – Full support
WebView Android 4.4.3 (Release date: 2014-06-02)
footnote Full support
WebView on iOS – Full support
WebView on iOS 10 (Release date: 2016-09-13)
footnote Full support
Bun – Full support
Bun 1 (Release date: 2023-09-08)
footnote Full support
Deno – Full support
Deno 1 (Release date: 2020-05-13)
footnote Full support
Node.js – Full support
Node.js 6.13 (Release date: 2018-02-13)
footnote Full support
searchParams
Chrome – Full support
Chrome 51 (Release date: 2016-05-25)
footnote Full support
Edge – Full support
Edge 17 (Release date: 2018-04-30)
footnote Full support
Firefox – Full support
Firefox 29 (Release date: 2014-04-29)
footnote Full support
Opera – Full support
Opera 38 (Release date: 2016-06-08)
footnote Full support
Safari – Full support
Safari 10.1 (Release date: 2017-03-27)
footnote Full support
Chrome Android – Full support
Chrome Android 51 (Release date: 2016-06-08)
footnote Full support
Firefox for Android – Full support
Firefox for Android 29 (Release date: 2014-04-29)
footnote Full support
Opera Android – Full support
Opera Android 41 (Release date: 2016-10-25)
footnote Full support
Safari on iOS – Full support
Safari on iOS 10.3 (Release date: 2017-03-27)
footnote Full support
Samsung Internet – Full support
Samsung Internet 5 (Release date: 2016-12-15)
footnote Full support
WebView Android – Full support
WebView Android 51 (Release date: 2016-06-08)
footnote Full support
WebView on iOS – Full support
WebView on iOS 10.3 (Release date: 2017-03-27)
footnote Full support
Bun – Full support
Bun 1 (Release date: 2023-09-08)
footnote Full support
Deno – Full support
Deno 1 (Release date: 2020-05-13)
footnote Full support
Node.js – No support
Node.js 6.13 – 6.13 (Release date: 2018-02-13)
unknown Support unknown
Node.js – Partial support
Node.js 7 – 7 (Release date: 2016-10-25)
footnote Partial support
footnote An object matching the URLSearchParams interface is returned, but it contains no data.
Node.js – Full support
Node.js 7.3 (Release date: 2016-12-20)
footnote Full support
toJSON
Chrome – Full support
Chrome 71 (Release date: 2018-12-04)
footnote Full support
Edge – Full support
Edge 17 (Release date: 2018-04-30)
footnote Full support
Firefox – Full support
Firefox 54 (Release date: 2017-06-13)
footnote Full support
Opera – Full support
Opera 58 (Release date: 2019-01-23)
footnote Full support
Safari – Full support
Safari 11 (Release date: 2017-09-19)
footnote Full support
Chrome Android – Full support
Chrome Android 71 (Release date: 2018-12-04)
footnote Full support
Firefox for Android – Full support
Firefox for Android 54 (Release date: 2017-06-13)
footnote Full support
Opera Android – Full support
Opera Android 50 (Release date: 2019-02-18)
footnote Full support
Safari on iOS – Full support
Safari on iOS 11 (Release date: 2017-09-19)
footnote Full support
Samsung Internet – Full support
Samsung Internet 10 (Release date: 2019-08-22)
footnote Full support
WebView Android – Full support
WebView Android 71 (Release date: 2018-12-04)
footnote Full support
WebView on iOS – Full support
WebView on iOS 11 (Release date: 2017-09-19)
footnote Full support
Bun – Full support
Bun 1 (Release date: 2023-09-08)
footnote Full support
Deno – Full support
Deno 1 (Release date: 2020-05-13)
footnote Full support
Node.js – No support
Node.js 6.13 – 6.13 (Release date: 2018-02-13)
footnote Removed in 7 and later
Node.js – Full support
Node.js 7.7 (Release date: 2017-02-28)
footnote Full support
toString
Chrome – Full support
Chrome 19 (Release date: 2012-05-15)
footnote Full support
Edge – Full support
Edge 17 (Release date: 2018-04-30)
footnote Full support
Firefox – Full support
Firefox 54 (Release date: 2017-06-13)
footnote Full support
Opera – Full support
Opera 15 (Release date: 2013-07-02)
footnote Full support
Safari – Full support
Safari 7 (Release date: 2013-10-22)
footnote Full support
Chrome Android – Full support
Chrome Android 25 (Release date: 2013-02-27)
footnote Full support
Firefox for Android – Full support
Firefox for Android 54 (Release date: 2017-06-13)
footnote Full support
Opera Android – Full support
Opera Android 14 (Release date: 2013-05-21)
footnote Full support
Safari on iOS – Full support
Safari on iOS 7 (Release date: 2013-09-18)
footnote Full support
Samsung Internet – Full support
Samsung Internet 6 (Release date: 2017-08-23)
footnote Full support
WebView Android – Full support
WebView Android 4.4 (Release date: 2013-12-09)
footnote Full support
WebView on iOS – Full support
WebView on iOS 7 (Release date: 2013-09-18)
footnote Full support
Bun – Full support
Bun 1 (Release date: 2023-09-08)
footnote Full support
Deno – Full support
Deno 1 (Release date: 2020-05-13)
footnote Full support
Node.js – Full support
Node.js 6.13 (Release date: 2018-02-13)
footnote Full support
username
Chrome – Full support
Chrome 32 (Release date: 2014-01-14)
footnote Full support
Edge – Full support
Edge 12 (Release date: 2015-07-29)
footnote Full support
Firefox – Full support
Firefox 26 (Release date: 2013-12-10)
footnote Full support
Opera – Full support
Opera 19 (Release date: 2014-01-28)
footnote Full support
Safari – Full support
Safari 10 (Release date: 2016-09-20)
footnote Full support
Chrome Android – Full support
Chrome Android 32 (Release date: 2014-01-15)
footnote Full support
Firefox for Android – Full support
Firefox for Android 26 (Release date: 2013-12-10)
footnote Full support
Opera Android – Full support
Opera Android 19 (Release date: 2014-01-28)
footnote Full support
Safari on iOS – Full support
Safari on iOS 10 (Release date: 2016-09-13)
footnote Full support
Samsung Internet – Full support
Samsung Internet 6 (Release date: 2017-08-23)
footnote Full support
WebView Android – Full support
WebView Android 4.4.3 (Release date: 2014-06-02)
footnote Full support
WebView on iOS – Full support
WebView on iOS 10 (Release date: 2016-09-13)
footnote Full support
Bun – Full support
Bun 1 (Release date: 2023-09-08)
footnote Full support
Deno – Full support
Deno 1 (Release date: 2020-05-13)
footnote Full support
Node.js – Full support
Node.js 6.13 (Release date: 2018-02-13)
footnote Full support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
Partial support
Partial support
In development. Supported in a pre-release version.
In development. Supported in a pre-release version.
No support
No support
Experimental. Expect behavior to change in the future.
See implementation notes.
Requires a vendor prefix or different name for use.
Has more compatibility info.

See also