CSV converters
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.
Convert CSV
- KML → CSVConvert KML to CSV
- CSV → KMLConvert CSV to KML
- GeoJSON → CSVConvert GeoJSON to CSV
- CSV → GeoJSONConvert CSV to GeoJSON
- SHP → CSVConvert Shapefile to CSV
- CSV → XLSXConvert CSV to Excel (XLSX)
- XLSX → CSVConvert Excel (XLSX) to CSV
- CSV → JSONConvert CSV to JSON
- JSON → CSVConvert JSON to CSV
What to know about CSV
- 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.
File extensions: .csv, .tsv, .txt
Where you meet CSV files
CSV files with coordinates come from spreadsheets of addresses and sites, GPS loggers, sensors, field survey apps and open-data portals. They are the usual way to get a list of points from Excel or Google Sheets into a map, and the usual way to get an attribute table out of GIS into a spreadsheet.
CSV compared with other formats
- CSV or Excel (XLSX)
- An Excel workbook keeps cell formats, so postcodes with a leading zero and dates survive. A CSV is plain text that every program reads, but how it is read depends on that program's language settings.
- CSV or GeoJSON
- GeoJSON stores real geometry and its coordinate system is fixed. A CSV stores coordinates as text columns, or WKT, and the coordinate system must be known separately.
- CSV or Shapefile
- A shapefile is the format to send when the points must open in GIS without any setup; a CSV needs the reader to say which columns hold the coordinates.
Common problems with CSV files
Decimal commas and semicolons
In much of Europe Excel saves CSV with semicolons between columns and a comma as decimal mark, so 55,6761 means 55.6761. Programs set up for English read that as text, and the points are lost. FileReshape's converters detect both. Tool: Convert CSV to GeoJSON.
Latitude and longitude are swapped
Latitude is north–south, longitude east–west. Swapped columns put points far away, for example Copenhagen in the Arabian Sea. A quick look at the map before converting catches it.
Coordinates in degrees, minutes and seconds
Most GIS programs need decimal degrees, so values such as 55°40'34"N must be converted: degrees + minutes / 60 + seconds / 3600, negative for south and west. FileReshape's CSV converter does this itself, and also splits a single column such as 55.6761, 12.5683 copied from Google Maps.
Leading zeros and odd letters after opening in Excel
Excel turns a postcode such as 0150 into 150 when it opens a CSV, and a file saved as "CSV (Comma delimited)" uses the Windows code page instead of UTF-8. Import with Data › From Text/CSV to set column types, and save with "CSV UTF-8".
Questions about CSV
How do I know which coordinate system the numbers are in?
Values between -180 and 180 and between -90 and 90 are almost always WGS84 longitude and latitude from a GPS or a web map. Values in the hundreds of thousands or millions are metres in a projected system such as a UTM zone; ask the source for the EPSG code.
Can a CSV hold lines and polygons?
Yes, as a column of WKT text such as LINESTRING (10 55, 11 56). QGIS and GDAL read it; Excel just shows the text.