GeoJSON Coordinate Flip Tool

Swap latitude and longitude coordinates in GeoJSON data to fix coordinate order issues.

Why Flip Coordinates?

One of the most common GeoJSON mistakes is swapping latitude and longitude. GeoJSON uses [longitude, latitude] order (matching the mathematical x, y convention), but many data sources provide coordinates as latitude first. When coordinates are swapped, features appear in the wrong location — often mirrored across the equator or prime meridian.

How the Flip Tool Works

This tool swaps the first two values of every coordinate in your GeoJSON. If your coordinates are currently [latitude, longitude], flipping converts them to the correct [longitude, latitude] order (and vice versa).

The flip is applied recursively to all coordinates in all geometries — Points, LineStrings, Polygons, and their Multi variants. Properties and structure remain unchanged.

How to Tell If Coordinates Are Swapped

  • Points that should be in North America appear in the middle of the ocean (or vice versa)
  • Longitude values are between -90 and 90 (these are likely latitudes)
  • Latitude values exceed 90 or are below -90 (these are likely longitudes)
  • The data came from a source that uses lat/lng order (many Google APIs, for example)

Paste your data into the viewer to visually check whether features appear in the expected location before and after flipping.

Try It

This Point has its coordinates in the wrong order — latitude first, then longitude. The raw values [40.7484, -73.9857] place the point off the coast of Antarctica instead of at the Empire State Building in Manhattan:

GeoJSON{
  "type": "Feature",
  "properties": { "name": "Empire State Building" },
  "geometry": {
    "type": "Point",
    "coordinates": [40.7484, -73.9857]
  }
}

After flipping, the coordinates become [-73.9857, 40.7484] — correct[longitude, latitude] order — and the point appears in midtown Manhattan where it belongs.

GeoJSON{
  "type": "Feature",
  "properties": { "name": "Empire State Building" },
  "geometry": {
    "type": "Point",
    "coordinates": [-73.9857, 40.7484]
  }
}

How It Works

The flip operation walks every coordinate array in the GeoJSON and swaps the first two elements (index 0 and index 1). For a coordinate [a, b], the result is [b, a]. If a third element exists (elevation), it is left in place. The operation is its own inverse — flipping twice returns the original data.

This is a common fix when importing data from APIs that return latitude-first coordinates (such as the Google Geocoding API) into GeoJSON, which requires longitude first per the RFC 7946 specification. For more background on coordinate order conventions, see the GeoJSON Specification Guide.