Convert CSV to GeoJSON
This converter turns a CSV with latitude and longitude columns or a WKT column into GeoJSON, handling the semicolons, decimal commas and Windows encoding that Excel often writes. The CSV is read in your browser and is not uploaded. Degrees, minutes and seconds and a single column copied from Google Maps are read too; addresses are not geocoded, and rows without valid coordinates are kept with a null geometry.
Did a file not convert correctly? E-mail [email protected], ideally with a small sample file, and it will be fixed.
Key facts
- Input: CSV (.csv). Output: GeoJSON (.geojson).
- Your files are not uploaded: the work is done in your browser, on your own device.
- File size: no fixed limit; very large files are limited by your device's memory.
- Needs a current browser (Chrome, Edge, Firefox or Safari) on a computer, tablet or phone; nothing to install.
- Free to use, with no sign-up.
CSV to GeoJSON: why convert
Lists of shops, sensors, sightings or customers often start life in Excel or Google Sheets, with one row per place and a latitude and a longitude column. To put them on a web map you need GeoJSON. This converter finds the coordinate columns on its own when they have usual names such as lat, latitude, lon, lng, longitude, x or y, or uses a column of WKT text such as POINT (12.57 55.68), which also allows lines and polygons. It copes with the CSV variants Excel writes in different countries: commas or semicolons, decimal points or decimal commas, UTF-8 or the older Windows encoding. If the columns are not recognised, you choose them yourself. Every other column becomes a property. The file is read in your browser and never uploaded.
How to convert CSV to GeoJSON
- Drop your .csv file in the box, or click to choose it.
- Check the columns used for the coordinates, and enter the coordinate system if they are not longitude and latitude.
- Click Convert and download your GeoJSON file.
What changes when you convert
How the coordinate columns are found
A column whose values look like WKT is used as the geometry first. Otherwise the longitude or X column is the first whose name starts with lon, lng or long, or is x or easting, and the latitude or Y column the first that starts with lat, or is y or northing. The summary shows which columns were used, and you can choose others. A point in Copenhagen with latitude and longitude swapped lands in the Arabian Sea, so a look at the map before converting is worth it. Addresses are not turned into coordinates; the file needs numbers or WKT.
Semicolons and decimal commas
In Germany, France, Denmark and many other countries, Excel saves CSV files with semicolons between columns and a comma as the decimal mark, so 55,6813 means 55.6813. The separator (comma, semicolon, tab or pipe) is detected from the header row, and an Excel "sep=" first line is honored. Decimal commas are understood in files separated by semicolons or tabs; in a comma-separated file a comma can only be a separator. In a file with decimal commas, numbers with a thousands separator, such as 1.200, stay text.
Degrees, minutes and seconds
Besides decimal degrees, the columns may hold degrees, minutes and seconds such as 55°40'52"N or 55 40 52 N, or degrees and decimal minutes such as N 55° 40.872', as GPS units and older surveys write them. N, S, E or W before or after the number sets the sign, and Ø and V from Danish and Norwegian maps are understood too. A single column with both values, such as 55.6761, 12.5683 copied from Google Maps, is split into latitude and longitude, and the summary shows the order it was read in. A row with 60 or more minutes or seconds is kept without a geometry.
Text encoding
UTF-8, with or without a byte order mark, and UTF-16 are recognised. A file that is not valid UTF-8 was usually saved by Excel as "CSV (Comma delimited)" in the Windows code page of the computer: Windows-1252 in Western Europe and the Americas, Shift_JIS in Japan, Windows-1250 in Poland, Windows-1251 for Cyrillic. The converter picks the code page the text reads most naturally in and shows it under "Read as". If letters still look wrong, save the file as "CSV UTF-8" first.
Numbers, text and empty cells
A column becomes a number in the GeoJSON only when all its values are numbers. Values with a leading zero, such as the postcode 0800 or the ID 000123, keep the column as text, so nothing is lost. The coordinate columns are not repeated as properties. Rows with an empty or unreadable coordinate are kept with "geometry": null, and the page tells you how many there are.
The coordinate system
A CSV does not say which coordinate system its numbers are in. Longitude and latitude are taken to be WGS84, as from a GPS or Google Maps. When the values are clearly not degrees, for example UTM eastings and northings in metres, the page asks for the EPSG code, such as EPSG:25832 or EPSG:27700, and reprojects to WGS84. EWKT values with SRID=... fill in the code for you.
About the formats
CSV
CSV (comma-separated values) is a plain-text table that opens in Excel, Google Sheets and every database. It has no geometry type of its own: locations are stored either as two coordinate columns, such as latitude and longitude, or as a column of WKT text.
- Points fit in two columns (X and Y, or longitude and latitude); lines and polygons need a WKT column.
- The coordinate system is not stored in the file, so note it separately.
- There is no standard for the separator: Excel uses a comma or a semicolon depending on the language settings.
- Every value is text; whether 0800 is a number or a postcode is up to the program reading it.
GeoJSON
GeoJSON is a plain-text JSON format for geographic features, standardized as RFC 7946 in 2016. It is the native format of web maps such as Leaflet, MapLibre and Mapbox, and of many APIs.
- Coordinates are WGS84 longitude, latitude (in that order).
- Points, lines and polygons can be mixed in one file.
- Properties can be any JSON value, with no limit on field name length.
Frequently asked questions
Is my CSV uploaded?
No. The file is read and converted by your own browser, so customer lists and other private addresses stay on your computer.
Which Excel option should I use to save the CSV?
"CSV UTF-8 (Comma delimited)" is the safest, because it keeps every character. The plain "CSV" option works too; the converter reads its Windows encoding and, in countries with a decimal comma, its semicolons.
Can the CSV contain lines and polygons?
Yes, in a WKT column. Each row holds one geometry, for example LINESTRING (12.56 55.67, 12.57 55.68) or a POLYGON or MULTIPOLYGON. Point coordinates in two columns can only give points.
Does it work with Google Sheets?
Yes. In Google Sheets choose File, Download, Comma-separated values, and drop that file here.