How to Convert KML to Shapefile
March 4, 2026 · ConvertGeoData Team
If you work with geographic data, you have probably needed to convert KML to Shapefile at some point. KML files are the standard format for Google Earth and Google Maps, but most professional GIS software like ArcGIS, QGIS, and MapInfo relies on the Shapefile format. Whether you have a single placemark file or a complex KMZ archive with dozens of layers, converting KML to SHP is a common and essential task in any geospatial workflow.
In this guide, we will walk through everything you need to know about the conversion process, including how to handle tricky issues like nested folders, style data, and multi-geometry layers. We will also point you to the fastest way to get the job done using ConvertGeoData.com.
What Are KML and Shapefile Formats?
KML (Keyhole Markup Language) is an XML-based format developed originally by Keyhole, Inc. and later adopted by Google. It stores geographic features like points, lines, polygons, and associated attributes such as names, descriptions, and styling information. KMZ files are simply compressed (zipped) KML files that may also contain embedded images or icons.
Shapefile is a vector data format created by Esri. It is the most widely supported GIS format in the industry. A single Shapefile actually consists of multiple component files (.shp, .shx, .dbf, .prj, and others), which together store geometry, attribute data, spatial indexing, and coordinate system information.
Because these two formats serve different ecosystems, converting between them is one of the most common geospatial format conversions. KML is great for visualization and sharing on the web, while Shapefile is better suited for analysis, editing, and data management in desktop GIS applications.
Why Convert KML to Shapefile?
There are several reasons you might need a KML Shapefile converter:
- GIS compatibility: Most professional GIS tools prefer Shapefile or GeoPackage over KML.
- Data analysis: Shapefiles integrate smoothly with spatial databases, geoprocessing tools, and cartographic workflows.
- Attribute preservation: While KML stores data in description fields or extended data, Shapefile stores structured attribute columns in a .dbf table, making queries and joins much easier.
- Collaboration: Many organizations and government agencies require data submissions in Shapefile format.
How to Convert KML to SHP: Step-by-Step
There are multiple ways to convert KML to Shapefile. Here are the most common approaches, from simplest to most technical.
Option 1: Use an Online Converter
The fastest way to convert KML to SHP is with an online tool like ConvertGeoData.com. Simply upload your KML or KMZ file, select Shapefile as the output format, and download the result. There is no software to install, and the conversion handles most common edge cases automatically.
Online converters are ideal when you need a quick result without setting up a full GIS environment. They work well for small to medium-sized files and handle coordinate system assignments, geometry type separation, and attribute extraction behind the scenes.
Option 2: Use QGIS
QGIS is a free, open-source GIS application that can read KML files directly. To convert:
- Open QGIS and drag your KML file into the Layers panel (or use Layer > Add Layer > Add Vector Layer).
- If the KML contains multiple geometry types, QGIS will ask you to select which ones to load.
- Right-click the loaded layer and choose Export > Save Features As.
- Set the format to "ESRI Shapefile," choose an output location, and click OK.
This method gives you full control over coordinate reference systems, attribute fields, and encoding options.
Option 3: Use ogr2ogr (Command Line)
For batch processing or scripting, the ogr2ogr utility from the GDAL/OGR library is the go-to tool. A basic conversion command looks like this:
ogr2ogr -f "ESRI Shapefile" output.shp input.kmlYou can add flags to filter by geometry type, reproject coordinates, or select specific layers from a multi-layer KML file. For example, to extract only polygon features:
ogr2ogr -f "ESRI Shapefile" output_polygons.shp input.kml -where "OGR_GEOMETRY='POLYGON'"
Handling Nested Folders in KML Files
KML files often organize features into nested folders and subfolders. This is great for organizing data in Google Earth, but it can cause confusion during conversion. Shapefiles have no concept of folders or hierarchical grouping.
When you convert a KML with nested folders, most tools will flatten the structure into a single layer. If your KML contains multiple folders that represent distinct datasets (for example, "Roads," "Buildings," and "Boundaries"), you may want to convert each folder into a separate Shapefile. In ogr2ogr, you can target specific layers by name:
ogr2ogr -f "ESRI Shapefile" roads.shp input.kml "Roads"On ConvertGeoData.com, multi-layer KML files are detected automatically, and you can choose how to handle them during the conversion process.
What Happens to Style Data?
KML files can store rich styling information, including icon colors, line widths, polygon fill colors, and label styles. Shapefiles, on the other hand, do not store any styling information. The visual appearance of a Shapefile is determined entirely by the GIS software rendering it.
During conversion, style data from KML is typically discarded. However, some tools can extract style properties (like color hex codes) and store them as attribute columns in the Shapefile's .dbf table. This lets you recreate the styling manually in your GIS application by using those attribute values for symbology rules.
If preserving visual styles is important to your workflow, consider using GeoPackage as an intermediate format, since it supports style storage natively. You can then convert from GeoPackage to Shapefile while retaining the style attributes as columns.
Tips for a Clean KML to Shapefile Conversion
Here are some practical tips to ensure your conversion goes smoothly:
- Separate geometry types: Shapefiles support only one geometry type per file (points, lines, or polygons). If your KML contains mixed geometry types, split them into separate Shapefiles.
- Check your coordinate system: KML files always use WGS 84 (EPSG:4326). Make sure your output Shapefile includes a correct .prj file, or reproject to your desired CRS during conversion.
- Watch for long field names: The .dbf format limits attribute field names to 10 characters. Longer names from KML extended data will be truncated.
- Handle KMZ properly: If you have a KMZ file, unzip it first to extract the .kml file inside, or use a tool that reads KMZ natively.
- Validate your output: After conversion, open the Shapefile in QGIS or another viewer to verify that features, attributes, and geometry all look correct.
Common Issues and How to Fix Them
Empty or missing attributes: KML files often store attribute data inside HTML description fields rather than structured ExtendedData elements. Many converters cannot parse HTML descriptions into clean attribute columns. If your output Shapefile has empty fields, check whether the source KML uses ExtendedData tags.
Missing features: If some features are missing after conversion, the cause is usually mixed geometry types. The converter may have exported only one type (for example, polygons) and skipped points or lines. Run the conversion once per geometry type to capture everything.
Encoding issues: KML uses UTF-8 encoding, but older Shapefile tools may default to ASCII or Latin-1. If you see garbled characters in attribute values, specify UTF-8 encoding during the export step or include a .cpg file set to UTF-8.
Convert KML to Shapefile Online with ConvertGeoData
If you want to skip the setup and get your Shapefile quickly, head over to ConvertGeoData.com. Our KML Shapefile converter handles single files, multi-layer KML archives, and KMZ packages with ease. Upload your file, pick your options, and download a clean, ready-to-use Shapefile in seconds.
Whether you are a GIS professional working with client data or a researcher pulling layers from Google Earth, converting KML to Shapefile does not have to be complicated. Use the right tool for the job, watch out for the common pitfalls we covered above, and your data will be ready for analysis in no time.