GeolocationCoordinates

Baseline Widely available *

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

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

Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

The GeolocationCoordinates interface represents the position and altitude of the device on Earth, as well as the accuracy with which these properties are calculated. The geographic position information is provided in terms of World Geodetic System coordinates (WGS84).

Instance properties

The GeolocationCoordinates interface doesn't inherit any properties.

GeolocationCoordinates.latitude Read only

Returns a double representing the position's latitude in decimal degrees.

GeolocationCoordinates.longitude Read only

Returns a double representing the position's longitude in decimal degrees.

GeolocationCoordinates.altitude Read only

Returns a double representing the position's altitude in meters, relative to nominal sea level. This value can be null if the implementation cannot provide the data.

GeolocationCoordinates.accuracy Read only

Returns a double representing the accuracy of the latitude and longitude properties, expressed in meters.

GeolocationCoordinates.altitudeAccuracy Read only

Returns a double representing the accuracy of the altitude expressed in meters. This value can be null if the implementation cannot provide the data.

GeolocationCoordinates.heading Read only

Returns a double representing the direction towards which the device is facing. This value, specified in degrees, indicates how far off from heading true north the device is. 0 degrees represents true north, and the direction is determined clockwise (which means that east is 90 degrees and west is 270 degrees). If speed is 0 or the device is unable to provide heading information, heading is null.

GeolocationCoordinates.speed Read only

Returns a double representing the velocity of the device in meters per second. This value can be null.

Instance methods

The GeolocationCoordinates interface doesn't inherit any methods.

GeolocationCoordinates.toJSON()

Returns a JSON representation of the GeolocationCoordinates object and enables serialization with JSON.stringify().

Specifications

Specification
Geolocation
# coordinates_interface

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
GeolocationCoordinates
Chrome – No support
Chrome 5 – 77 (Release date: 2010-05-25)
altname
footnote Removed in 78 and later
altname Alternate name: Coordinates
Chrome – Full support
Chrome 79 (Release date: 2019-12-10)
footnote Full support
Edge – No support
Edge 12 – 18 (Release date: 2015-07-29)
altname
altname Alternate name: Coordinates
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – No support
Firefox 3.5 – 70 (Release date: 2009-06-30)
altname
footnote Removed in 71 and later
altname Alternate name: Coordinates
Firefox – Full support
Firefox 72 (Release date: 2020-01-07)
footnote Full support
Opera – No support
Opera 10.6 – 12.1 (Release date: 2010-07-01)
footnote Removed in 15 and later
Opera – Full support
Opera 16 (Release date: 2013-08-27)
altname
altname Alternate name: Coordinates
Safari – No support
Safari 5 – 13 (Release date: 2010-06-07)
altname
altname Alternate name: Coordinates
Safari – Full support
Safari 13.1 (Release date: 2020-03-24)
footnote Full support
Chrome Android – No support
Chrome Android 18 – 77 (Release date: 2012-06-27)
altname
footnote Removed in 78 and later
altname Alternate name: Coordinates
Chrome Android – Full support
Chrome Android 79 (Release date: 2019-12-17)
footnote Full support
Firefox for Android – No support
Firefox for Android 4 – 68 (Release date: 2011-03-29)
altname
altname Alternate name: Coordinates
Firefox for Android – Full support
Firefox for Android 79 (Release date: 2020-07-28)
footnote Full support
Opera Android – No support
Opera Android 11 – 12.1 (Release date: 2011-03-22)
footnote Removed in 14 and later
Opera Android – Full support
Opera Android 16 (Release date: 2013-09-18)
footnote Full support
Safari on iOS – No support
Safari on iOS 3 – 13 (Release date: 2009-06-17)
altname
altname Alternate name: Coordinates
Safari on iOS – Full support
Safari on iOS 13.4 (Release date: 2020-03-24)
footnote Full support
Samsung Internet – No support
Samsung Internet 1 – 11.2 (Release date: 2013-04-27)
altname
altname Alternate name: Coordinates
Samsung Internet – Full support
Samsung Internet 12 (Release date: 2020-06-19)
footnote Full support
WebView Android – No support
WebView Android 4.4 – 77 (Release date: 2013-12-09)
altname
footnote Removed in 78 and later
altname Alternate name: Coordinates
WebView Android – Full support
WebView Android 79 (Release date: 2019-12-17)
footnote Full support
WebView on iOS – No support
WebView on iOS 3 – 13 (Release date: 2009-06-17)
altname
altname Alternate name: Coordinates
WebView on iOS – Full support
WebView on iOS 13.4 (Release date: 2020-03-24)
footnote Full support
accuracy
Chrome – Full support
Chrome 5 (Release date: 2010-05-25)
footnote Full support
Edge – Full support
Edge 12 (Release date: 2015-07-29)
footnote Full support
Firefox – Full support
Firefox 3.5 (Release date: 2009-06-30)
footnote Full support
Opera – No support
Opera 10.6 – 12.1 (Release date: 2010-07-01)
footnote Removed in 15 and later
Opera – Full support
Opera 16 (Release date: 2013-08-27)
footnote Full support
Safari – Full support
Safari 5 (Release date: 2010-06-07)
footnote Full support
Chrome Android – Full support
Chrome Android 18 (Release date: 2012-06-27)
footnote Full support
Firefox for Android – Full support
Firefox for Android 4 (Release date: 2011-03-29)
footnote Full support
Opera Android – No support
Opera Android 11 – 12.1 (Release date: 2011-03-22)
footnote Removed in 14 and later
Opera Android – Full support
Opera Android 16 (Release date: 2013-09-18)
footnote Full support
Safari on iOS – Full support
Safari on iOS 3 (Release date: 2009-06-17)
footnote Full support
Samsung Internet – Full support
Samsung Internet 1 (Release date: 2013-04-27)
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 3 (Release date: 2009-06-17)
footnote Full support
altitude
Chrome – Full support
Chrome 5 (Release date: 2010-05-25)
footnote Full support
Edge – Full support
Edge 12 (Release date: 2015-07-29)
footnote Full support
Firefox – Full support
Firefox 3.5 (Release date: 2009-06-30)
footnote Full support
Opera – No support
Opera 10.6 – 12.1 (Release date: 2010-07-01)
footnote Removed in 15 and later
Opera – Full support
Opera 16 (Release date: 2013-08-27)
footnote Full support
Safari – Full support
Safari 5 (Release date: 2010-06-07)
footnote Full support
Chrome Android – Full support
Chrome Android 18 (Release date: 2012-06-27)
footnote Full support
Firefox for Android – Full support
Firefox for Android 4 (Release date: 2011-03-29)
footnote Full support
Opera Android – No support
Opera Android 11 – 12.1 (Release date: 2011-03-22)
footnote Removed in 14 and later
Opera Android – Full support
Opera Android 16 (Release date: 2013-09-18)
footnote Full support
Safari on iOS – Full support
Safari on iOS 3 (Release date: 2009-06-17)
footnote Full support
Samsung Internet – Full support
Samsung Internet 1 (Release date: 2013-04-27)
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 3 (Release date: 2009-06-17)
footnote Full support
altitudeAccuracy
Chrome – Full support
Chrome 5 (Release date: 2010-05-25)
footnote Full support
Edge – Full support
Edge 12 (Release date: 2015-07-29)
footnote Full support
Firefox – Full support
Firefox 3.5 (Release date: 2009-06-30)
footnote Full support
Opera – No support
Opera 10.6 – 12.1 (Release date: 2010-07-01)
footnote Removed in 15 and later
Opera – Full support
Opera 16 (Release date: 2013-08-27)
footnote Full support
Safari – Full support
Safari 5 (Release date: 2010-06-07)
footnote Full support
Chrome Android – Full support
Chrome Android 18 (Release date: 2012-06-27)
footnote Full support
Firefox for Android – Full support
Firefox for Android 4 (Release date: 2011-03-29)
footnote Full support
Opera Android – No support
Opera Android 11 – 12.1 (Release date: 2011-03-22)
footnote Removed in 14 and later
Opera Android – Full support
Opera Android 16 (Release date: 2013-09-18)
footnote Full support
Safari on iOS – Full support
Safari on iOS 3 (Release date: 2009-06-17)
footnote Full support
Samsung Internet – Full support
Samsung Internet 1 (Release date: 2013-04-27)
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 3 (Release date: 2009-06-17)
footnote Full support
heading
Chrome – Full support
Chrome 5 (Release date: 2010-05-25)
footnote Full support
Edge – Full support
Edge 12 (Release date: 2015-07-29)
footnote Full support
Firefox – Full support
Firefox 3.5 (Release date: 2009-06-30)
footnote Full support
Opera – No support
Opera 10.6 – 12.1 (Release date: 2010-07-01)
footnote Removed in 15 and later
Opera – Full support
Opera 16 (Release date: 2013-08-27)
footnote Full support
Safari – Full support
Safari 5 (Release date: 2010-06-07)
footnote Full support
Chrome Android – Full support
Chrome Android 18 (Release date: 2012-06-27)
footnote Full support
Firefox for Android – Full support
Firefox for Android 4 (Release date: 2011-03-29)
footnote Full support
Opera Android – No support
Opera Android 11 – 12.1 (Release date: 2011-03-22)
footnote Removed in 14 and later
Opera Android – Full support
Opera Android 16 (Release date: 2013-09-18)
footnote Full support
Safari on iOS – Full support
Safari on iOS 3 (Release date: 2009-06-17)
footnote Full support
Samsung Internet – Full support
Samsung Internet 1 (Release date: 2013-04-27)
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 3 (Release date: 2009-06-17)
footnote Full support
latitude
Chrome – Full support
Chrome 5 (Release date: 2010-05-25)
footnote Full support
Edge – Full support
Edge 12 (Release date: 2015-07-29)
footnote Full support
Firefox – Full support
Firefox 3.5 (Release date: 2009-06-30)
footnote Full support
Opera – No support
Opera 10.6 – 12.1 (Release date: 2010-07-01)
footnote Removed in 15 and later
Opera – Full support
Opera 16 (Release date: 2013-08-27)
footnote Full support
Safari – Full support
Safari 5 (Release date: 2010-06-07)
footnote Full support
Chrome Android – Full support
Chrome Android 18 (Release date: 2012-06-27)
footnote Full support
Firefox for Android – Full support
Firefox for Android 4 (Release date: 2011-03-29)
footnote Full support
Opera Android – No support
Opera Android 11 – 12.1 (Release date: 2011-03-22)
footnote Removed in 14 and later
Opera Android – Full support
Opera Android 16 (Release date: 2013-09-18)
footnote Full support
Safari on iOS – Full support
Safari on iOS 3 (Release date: 2009-06-17)
footnote Full support
Samsung Internet – Full support
Samsung Internet 1 (Release date: 2013-04-27)
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 3 (Release date: 2009-06-17)
footnote Full support
longitude
Chrome – Full support
Chrome 5 (Release date: 2010-05-25)
footnote Full support
Edge – Full support
Edge 12 (Release date: 2015-07-29)
footnote Full support
Firefox – Full support
Firefox 3.5 (Release date: 2009-06-30)
footnote Full support
Opera – No support
Opera 10.6 – 12.1 (Release date: 2010-07-01)
footnote Removed in 15 and later
Opera – Full support
Opera 16 (Release date: 2013-08-27)
footnote Full support
Safari – Full support
Safari 5 (Release date: 2010-06-07)
footnote Full support
Chrome Android – Full support
Chrome Android 18 (Release date: 2012-06-27)
footnote Full support
Firefox for Android – Full support
Firefox for Android 4 (Release date: 2011-03-29)
footnote Full support
Opera Android – No support
Opera Android 11 – 12.1 (Release date: 2011-03-22)
footnote Removed in 14 and later
Opera Android – Full support
Opera Android 16 (Release date: 2013-09-18)
footnote Full support
Safari on iOS – Full support
Safari on iOS 3 (Release date: 2009-06-17)
footnote Full support
Samsung Internet – Full support
Samsung Internet 1 (Release date: 2013-04-27)
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 3 (Release date: 2009-06-17)
footnote Full support
Secure context required
Chrome – Full support
Chrome 47 (Release date: 2015-12-01)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – Full support
Firefox 55 (Release date: 2017-08-08)
footnote Full support
Opera – Full support
Opera 34 (Release date: 2015-12-08)
footnote Full support
Safari – Full support
Safari 10 (Release date: 2016-09-20)
footnote Full support
Chrome Android – Full support
Chrome Android 47 (Release date: 2015-12-02)
footnote Full support
Firefox for Android – Full support
Firefox for Android 55 (Release date: 2017-08-08)
footnote Full support
Opera Android – Full support
Opera Android 34 (Release date: 2015-12-16)
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 5 (Release date: 2016-12-15)
footnote Full support
WebView Android – Full support
WebView Android 47 (Release date: 2015-12-02)
footnote Full support
WebView on iOS – Full support
WebView on iOS 10 (Release date: 2016-09-13)
footnote Full support
speed
Chrome – Full support
Chrome 5 (Release date: 2010-05-25)
footnote Full support
Edge – Full support
Edge 12 (Release date: 2015-07-29)
footnote Full support
Firefox – Full support
Firefox 3.5 (Release date: 2009-06-30)
footnote Full support
Opera – No support
Opera 10.6 – 12.1 (Release date: 2010-07-01)
footnote Removed in 15 and later
Opera – Full support
Opera 16 (Release date: 2013-08-27)
footnote Full support
Safari – Full support
Safari 5 (Release date: 2010-06-07)
footnote Full support
Chrome Android – Full support
Chrome Android 18 (Release date: 2012-06-27)
footnote Full support
Firefox for Android – Full support
Firefox for Android 4 (Release date: 2011-03-29)
footnote Full support
Opera Android – No support
Opera Android 11 – 12.1 (Release date: 2011-03-22)
footnote Removed in 14 and later
Opera Android – Full support
Opera Android 16 (Release date: 2013-09-18)
footnote Full support
Safari on iOS – Full support
Safari on iOS 3 (Release date: 2009-06-17)
footnote Full support
Samsung Internet – Full support
Samsung Internet 1 (Release date: 2013-04-27)
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 3 (Release date: 2009-06-17)
footnote Full support
toJSON
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 129 (Release date: 2024-08-06)
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 129 (Release date: 2024-08-06)
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

Legend

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

Full support
Full support
Uses a non-standard name
Has more compatibility info.

See also