CSV to GeoJSON

Convert CSV data with coordinates to GeoJSON format.

About CSV to GeoJSON

Web maps built with Leaflet, Mapbox GL, OpenLayers or Google Maps expect GeoJSON, not a spreadsheet. This tool reads a CSV that has longitude and latitude columns and produces a FeatureCollection of Point features, keeping every other column as a property of the feature so pop-ups and filters keep working.

Paste the CSV, check the detected coordinate columns, click Convert and download or copy the GeoJSON. The conversion runs in your browser, so location data stays private.

How to use CSV to GeoJSON step by step

  1. Paste the comma-separated CSV with a header line. The tool detects the columns whose names contain lon, lng, x, lat or y and pre-selects them.
  2. Correct the longitude and latitude column selections if the detection picked the wrong ones.
  3. Click "Convert to GeoJSON". The pretty-printed FeatureCollection appears in the result box.
  4. Copy the result or download it as a .geojson file.

Input and output example

Input

name,city,longitude,latitude
Office,Madrid,-3.7038,40.4168
Warehouse,Barcelona,2.1734,41.3851

Output

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "geometry": { "type": "Point", "coordinates": [-3.7038, 40.4168] },
      "properties": { "name": "Office", "city": "Madrid", "longitude": "-3.7038", "latitude": "40.4168" }
    },
    ...
  ]
}

Why use our CSV to GeoJSON?

Common use cases

Limits and tips

Frequently asked questions

Which order do coordinates use in GeoJSON?

GeoJSON coordinates are [longitude, latitude], the reverse of the lat, lon order used in conversation and in Google Maps URLs. The tool writes them correctly as long as you select the right columns; swapping them places points in the ocean or in Antarctica.

How does the automatic column detection work?

The header names are compared in lower case: the first column containing lon, lng or x is proposed as longitude and the first containing lat or y as latitude. A column called tax would match x, so always check the selection.

What is the difference between GeoJSON and KML?

GeoJSON is JSON, lightweight and native to web mapping libraries; KML is XML, includes styling and is native to Google Earth. Many tools read both. This site offers CSV to KML as well if your destination is Google Earth or My Maps.

Can I convert addresses without coordinates?

No. The CSV must already contain longitude and latitude. Geocode the addresses first with a service such as Nominatim, Google Geocoding or a spreadsheet add-on, then convert.

Is the CSV uploaded?

No. Parsing and JSON generation happen in your browser; the file is created locally.

Related guides

Related tools

Other free utilities you may find useful

Available languages