Convert a file
Home › Guides › How to convert a Shapefile to KML (free, in your browser)

How to convert a Shapefile to KML (free, in your browser)

Desktop GIS speaks shapefile, and Google Earth speaks KML, so sooner or later you have to convert a Shapefile to KML. This guide covers the quickest way: free, in your browser, with nothing uploaded.

Key facts

  • A working shapefile is 5 files; the .prj carries the coordinate system KML needs.
  • KML is always WGS84 (EPSG:4326), so shapefile data is reprojected on the way out.
  • Field names longer than 10 characters were already shortened by the .dbf before the conversion.

The 5 steps

A shapefile is a bundle of files that travel together, so the job starts with gathering them.

Convert a Shapefile to KML: zip the .shp, .dbf, .shx and .prj, then convert Shapefile to KML for Google Earth
Zip the shapefile parts together first, then export to KML for Google Earth.
  1. Gather the parts, which means at least the .shp, .dbf and .shx, plus the .prj.
  2. Zip them into a single .zip archive.
  3. Open the Shapefile to KML converter and drop the .zip onto it.
  4. Pick KML or KMZ as the output, and set a coordinate system only if the .prj is missing.
  5. Click Convert and open the result in Google Earth.

Zip the parts correctly

Select the files themselves and compress those, rather than zipping the folder that holds them, because a flat archive always works. Check as well that every part shares the same base name: roads.shp pairs with roads.dbf, not with roads_final.dbf.

Keep the .prj

KML is always WGS84 longitude and latitude, whatever system the shapefile started in. The converter reprojects your data on the way through, but only when it knows the starting system, and the .prj is what tells it. Without a .prj, values like 451234 and 5411932 are read as degrees when they are really meters, and the data lands far from where it belongs. If the .prj is lost, set the system yourself, for example EPSG:27700 for the British National Grid, and other codes can be looked up at epsg.io.

Make it look right in Google Earth

A converted shapefile lands in Google Earth as raw geometry with its attributes attached, and a few small fixes make most of the difference.

SymptomFix
Labels are numeric IDsPick a short, meaningful name column
Labels overlapKeep names short
Flat data floats above the terrainDrop stray Z values you do not need
Accents show as question marksInclude the .cpg file in the zip

Going back again

KML to Shapefile turns a Google Earth file back into a shapefile and pulls popup data into proper columns while it does so. A round trip is not lossless, though: field names are squeezed back to 10 characters, and mixed geometry is split by type because a shapefile holds a single geometry type. If you need a format that loses nothing, write a GeoPackage instead.

“Convert a shapefile to KML and it just works in Google Earth, as long as the .prj came along. Without it, the tool is guessing your coordinate system.”
Ghulam Hasnain, PhD researcher in Space Science & Technology and the maker of GISConverters

Frequently asked questions

Do I need ArcGIS or QGIS to convert a Shapefile to KML?

No. The browser converter runs the same GDAL engine those programs use, compiled to WebAssembly, so no desktop install is needed and the conversion happens on your own machine.

Will my attribute table survive?

Yes. The .dbf columns become attributes on each placemark and appear in the Google Earth popup. Any truncation you see was introduced by the shapefile's own 10-character field limit, not by the conversion.

Should I pick KML or KMZ?

KMZ when emailing large files, since it is the same data zipped to a fraction of the size. KML when someone will edit the file, because any text editor can open it.

Why is my converted KML in the wrong location?

Almost always a missing or wrong .prj file. If the shapefile is in a projected system such as UTM or a national grid and no coordinate system is declared, the meter values get treated as degrees and the data lands far from where it should. Include the .prj, or set the coordinate system manually before converting.

Which shapefile files do I need to include?

At minimum .shp (geometry), .dbf (attributes) and .shx (index). Always add the .prj as well, because it records the coordinate system; without it the converter cannot reproject your data to the WGS84 that KML requires.

About the author

Ghulam Hasnain is a PhD researcher in space science and technology who works with GIS and remote-sensing data every day, wrangling shapefiles, KML, GPX and CAD drawings across QGIS, ArcGIS and Google Earth. He built GISConverters after one too many format conversions that required uploading sensitive survey data to a stranger's server.