Shard Tools

CSV to GeoJSON

Convert a CSV with latitude and longitude columns to GeoJSON in your browser, ready for mapping tools.

Maintained by Roshan.

Use CSV to GeoJSON

Converts csv with lat/lon to geojson in this tab, with nothing sent anywhere.

Runs entirely on your deviceThe conversion happens in this browser tab. Nothing you type is uploaded, logged or stored, which is worth knowing for anything you would not paste into a search box.

Explore developer and data tools

Find related browser-local tools for nearby tasks without starting another search.

Browse all developer and data tools

About CSV to GeoJSON

The other direction: you have location data in a spreadsheet - a CSV with latitude and longitude columns and perhaps a name or a value for each point - and you want to put it on a map. Mapping libraries and tools speak GeoJSON, not CSV, so this converts your table into a GeoJSON feature collection, one point per row, with the remaining columns carried through as each point's properties. It recognises the common names for coordinate columns - latitude and longitude, lat and lon, lng, even x and y - so a table from almost any source works without renaming. The result drops straight into a mapping library, and because it is built in the browser, a dataset of sensitive locations never has to be uploaded to convert.

Work through the input

  1. The CSV is parsed, quote-aware, and the header row inspected for coordinate columns.
  2. Latitude and longitude are located by their common names - lat, latitude, y for one; lon, lng, longitude, x for the other.
  3. Each row becomes a GeoJSON point feature at those coordinates.
  4. The remaining columns are carried through as the feature's properties, keeping their original names.
  5. The features are wrapped in a standard FeatureCollection, ready for a mapping tool.

When csv to geojson is useful

Mapping a spreadsheet

Add lat and lon columns to your data, convert here, and load the GeoJSON into a mapping library to see the points.

Sharing location data

GeoJSON is the interchange format mapping tools expect. This turns a plain table into it without uploading the locations.

Check the output

Questions about CSV to GeoJSON

What columns does it need?

A latitude and a longitude column. It recognises lat/latitude/y and lon/lng/longitude/x.

What happens to my other columns?

They become each point's properties, keeping their names, so a name or value travels with the point.

Does it make lines or polygons?

No. It makes point features, one per row. Building paths from rows is a separate task.

What if a coordinate is missing?

If there are no recognisable coordinate columns, the conversion is refused with a message rather than producing bad data.

Related tools

GeoJSON to CSV

Convert GeoJSON point features to CSV in your browser, with longitude, latitude and properties as columns.

GPX to GeoJSON

Convert a GPX GPS track or waypoints to GeoJSON in your browser, ready for mapping tools.

CSV to vCard

Convert a CSV of contacts to a vCard (.vcf) file in your browser, ready to import into a phone or address book.