KML to CSV converter

Get the places from a Google Earth or Google My Maps file as a spreadsheet: one row per placemark, with latitude, longitude and every field. Opens in Excel and Google Sheets. Free, and no account needed.

Drop a KML or KMZ file here

Download the sample

Your file stays on your computer: nothing is uploaded.

In short

Convert KML to CSV online, in your browser

The Spatibase KML to CSV converter turns a KML or KMZ file into a CSV table in your web browser. What you get:

  • One row per placemark. Each row holds the name, the description as plain text, the folder, every ExtendedData field, latitude and longitude for points, and a wkt column with the shape of every point, line and area.
  • Made for spreadsheets. The file is UTF-8 with a byte order mark, so Excel shows accents correctly, and styles and icons are left out.
  • Never uploaded. Your file is read on your computer. Files up to 50 MB work, with no account.
How to

How to convert KML to CSV

  1. Export the map. In Google My Maps, use the menu next to the map’s title → Export to KML/KMZ (pick one layer or the whole map). In Google Earth Pro, right-click a folder in Places → Save Place As.
  2. Drop the .kml or .kmz on the box above, or press Choose a file.
  3. Look over the map and the list under it: each place there becomes a row in the CSV.
  4. Press Download CSV.
  5. Open it in Excel with a double-click, or in Google Sheets with File → Import → Upload.
What’s kept

Which KML data ends up in the CSV

WhatWhat happens
PlacemarksOne row each, from every folder, in the order of the file.
NameThe name column, first in the table.
DescriptionThe description column, as plain text. HTML tags are removed; line breaks stay inside the cell.
FolderThe folder column. Nested folders read like Trip / Day 2.
ExtendedData fieldsOne column per field. A placemark without that field gets an empty cell.
Point coordinateslatitude and longitude columns in decimal degrees, latitude first.
Lines and areasTheir full shape in the wkt column, such as LINESTRING (2.17 41.38, 2.18 41.37). Their latitude and longitude cells stay empty.
AltitudeDropped. The WKT holds longitude and latitude only.
Styles, icons, overlaysLeft out. Image overlays and network links are counted in the notes.
Formats

From KML to a spreadsheet: latitude, longitude and WKT

KML hides the coordinates in one tag. Inside a KML, a pin is stored as 2.174356,41.403629,0: longitude, latitude and altitude in a single <coordinates> text. Copying that into a sheet by hand means splitting it and swapping the order.

The CSV splits them for you:

  • Points get two columns. A latitude and a longitude, latitude first, the way Google Maps and most people write them. You can sort, filter or paste them into another tool.
  • Lines and areas go into wkt. A path or a boundary doesn’t fit in two columns, so its shape is written as WKT (Well-Known Text). QGIS, PostGIS, BigQuery and Google My Maps can turn that column back into shapes.
  • Everything in one file. Folders don’t split the output: all placemarks land in one table, and the folder column tells you where each came from. Filter on it to get one folder.

Excel shows one column? Excel set to a European language expects semicolons. Open the CSV with Data → From Text/CSV instead and choose Comma as the delimiter.

Do it in code

Convert KML to CSV with ogr2ogr

With GDAL installed (QGIS includes it), one command writes the CSV. The GEOMETRY option decides how the location is stored:

# points: X (longitude) and Y (latitude) columns
ogr2ogr -f CSV out/ places.kml -lco GEOMETRY=AS_XY

# any shape: a WKT column
ogr2ogr -f CSV out/ places.kml -lco GEOMETRY=AS_WKT

How the result differs from this page: ogr2ogr writes one CSV per KML folder, puts longitude (X) before latitude (Y), keeps descriptions as HTML and adds KML settings such as tessellate and visibility as columns.

In JavaScript, @tmcw/togeojson reads the KML into GeoJSON; each feature’s properties plus its coordinates then make one row.

FAQ

Questions about converting KML to CSV

How do I get the coordinates from a KML file into Excel?

Convert it here and open the CSV. Every point has its own latitude and longitude columns in decimal degrees, next to its name, description and fields. Lines and areas have their shape in the wkt column instead.

Can Excel open a KML file directly?

Only as raw XML. Excel can load a .kml as an XML table, but the coordinates stay one text value per placemark, with longitude, latitude and altitude run together. A CSV from this page gives clean latitude and longitude columns.

Why are latitude and longitude empty for some rows?

Those rows are lines or areas, which have many coordinates rather than one. Their whole shape is in the wkt column, which QGIS, PostGIS and Google My Maps can read.

How do I export Google My Maps to Excel?

My Maps exports KML or KMZ, not spreadsheets. Use Export to KML/KMZ from the map’s menu, drop the file here and press Download CSV. The columns you imported into My Maps come back as columns.

Does it convert KMZ files to CSV too?

Yes. A KMZ is a zipped KML, and the converter unzips it first. Photos and icons inside the KMZ are not part of the CSV.

Is my KML sent to a server?

No. The conversion runs in your browser, on your computer, and the file is never uploaded to Spatibase or anyone else. Only the background map loads from the internet.

Moving the places into Spatibase? Read how to import your data. Need another pair of formats? The GIS file converter converts between all of them.

Talk to us

Not sure it’s a fit? Let’s find out

Tell us about your use case and what you need, from data model to security and deployment. In 30 minutes we’ll look at it together and tell you honestly if we can help.

Or write to hello@spatibase.com.