Data

Geolocation JSON Example

Geolocation JSON example with latitude, longitude, accuracy, altitude, and reverse-geocoded address. Matches the browser Geolocation API and GeoJSON formats.

{
  "coords": {
    "latitude": 21.1702,
    "longitude": 72.8311,
    "accuracy": 15,
    "altitude": 12.5,
    "altitudeAccuracy": 5,
    "heading": 270,
    "speed": 0
  },
  "timestamp": 1716268800000,
  "address": {
    "street": "MG Road",
    "city": "Surat",
    "state": "Gujarat",
    "postalCode": "395007",
    "country": "India",
    "countryCode": "IN",
    "formattedAddress": "MG Road, Surat, Gujarat 395007, India"
  },
  "source": "gps",
  "provider": "google_maps"
}

Field Reference

coords.latitudenumberrequiredDecimal degrees north/south. Range: -90 (south pole) to +90 (north pole).
coords.longitudenumberrequiredDecimal degrees east/west. Range: -180 to +180. Positive = east.
coords.accuracynumberrequiredEstimated accuracy radius in metres. Lower is better. GPS is typically 2-15m.
coords.altitudenumber | nulloptionalAltitude in metres above sea level. null if the device cannot determine it.
timestampinteger (Unix ms)requiredWhen the location was sampled, in milliseconds since the Unix epoch.
sourcestringoptionalLocation source: gps, network, ip, manual. Each has different accuracy characteristics.

Variants

Browser Geolocation APIExact shape returned by navigator.geolocation.getCurrentPosition().
Browser Geolocation API
{
  "coords": {
    "latitude": 21.1702,
    "longitude": 72.8311,
    "accuracy": 15,
    "altitude": null,
    "altitudeAccuracy": null,
    "heading": null,
    "speed": null
  },
  "timestamp": 1716268800000
}
GeoJSON PointRFC 7946 GeoJSON format used by PostGIS, Mapbox, and mapping libraries.
GeoJSON Point
{
  "type": "Feature",
  "geometry": {
    "type": "Point",
    "coordinates": [
      72.8311,
      21.1702
    ]
  },
  "properties": {
    "name": "Surat City Center",
    "accuracy": 15,
    "timestamp": 1716268800000
  }
}

Common Use Cases

  • Real-time location tracking for delivery and logistics apps
  • Store locator — finding the nearest branch to the user's position
  • Geotagging photos, posts, or check-ins with coordinates
geolocationGPScoordinatesmapslocation

Validate or format this JSON

Paste the example above into JSONKit's tools to validate, minify, or explore the structure interactively.

Frequently Asked Questions

GeoJSON (RFC 7946) uses [longitude, latitude] order — the opposite of what most people expect. The browser Geolocation API uses separate named fields (latitude, longitude). Always use named fields when possible to avoid confusion.

5 decimal places give ~1 metre accuracy, which is sufficient for most apps. 7 decimal places give centimetre accuracy (surveying). Storing 14+ decimal places is meaningless for GPS data — the hardware is not that precise.

GPS uses satellites for high accuracy (2-15m) but is slow to acquire (10-30 seconds) and drains battery. Network location uses Wi-Fi and cell towers: responds in milliseconds but is less accurate (20-2000m). The browser Geolocation API combines both automatically.

Related JSON Examples