Converting between KML and shapefile (SHP) format

Using the open source ogr2ogr from GDAL/OGR:

ogr2ogr -f 'ESRI Shapefile' output.shp input.kml

or for the reverse:

ogr2ogr -f KML output.kml input.shp 

As noted in grego's comment below, you may need to use double quotes instead of single quotes for the output format option (e.g. "ESRI Shapefile" for the Windows command line). See also the gdal wiki.


ArcGIS 10 has a GP tool called KML To Layer that converts KML to a feature class. Search for KML using the new search. I've used this to take the oil spill kml feeds from Google and convert them into SHP.

KML To Layer can only create a geodatabase feature class so that needs to be followed by a Feature Class To Feature Class step to convert it to a shapefile.


Use ogr2ogr, but if you're not interested in a command line, try ogr2gui - a really simple front end for ogr2ogr.