JoseFitani
🌐 GIS & Formats

KML Converter

This tool converts KML files (the XML format used by Google Earth) into GeoJSON, the open standard used by most web-mapping tools. Upload a .kml file and you get a live map preview of every converted Point, LineString and Polygon, plus a one-click GeoJSON download.

The conversion happens entirely in your browser — the file is never uploaded to a server. Only geometry and placemark names are carried over: KML styling, icons, descriptions and embedded media are not converted, and nested MultiGeometry elements are flattened into individual features.

Loading map…

How to use this tool

1
Upload a KML file

Click Upload .kml file and choose a KML document from your device. It is read locally by your browser.

2
Review the conversion

The tool parses every Placemark, converts Points, LineStrings and Polygons to GeoJSON features, and draws them on the map with a count of each geometry type.

3
Download the GeoJSON

Click Download GeoJSON to save the converted FeatureCollection to your device for use in QGIS, Leaflet, Mapbox or any other GeoJSON consumer.

What people use this tool for

Move Google Earth data to a web map

Placemarks drawn in Google Earth can be converted here into GeoJSON ready for Leaflet or Mapbox GL without installing desktop software.

Example: Convert a My Places folder of trailheads into GeoJSON for a hiking website.
Prepare KML for QGIS or PostGIS

GeoJSON imports cleanly into QGIS, PostGIS (ST_GeomFromGeoJSON) and most spatial databases, making this a quick bridge from KML.

Example: Convert a KML of survey points before loading them into a PostGIS table.
Audit what's inside a KML

The per-type counts and map preview reveal whether a KML contains the geometry you expect before you commit to a larger workflow.

Example: Check that a shared KML actually contains polygons and not just point markers.

How it's calculated

The file is read as text and parsed with DOMParser as XML. Every Placemark element is inspected (namespace-aware), its name is kept as a feature property, and Point, LineString and Polygon children are extracted. KML coordinates are lng,lat[,altitude] and are flipped to GeoJSON's [lng, lat] order. Polygon outer rings become Polygon coordinates. The resulting FeatureCollection is rendered with Leaflet's L.geoJSON and offered as a Blob download. No data leaves the browser.

Related tools and resources

Once converted, preview or debug the output in the GeoJSON viewer, or view GPS tracks in the GPX viewer.

Frequently asked questions

Is my KML file uploaded anywhere?

No. The file is read and parsed entirely in your browser using the DOMParser API. The conversion and the GeoJSON download are generated locally.

Are KML styles, icons and descriptions preserved?

No. Only geometry and the placemark name are converted. KML styling, custom icons, HTML descriptions and embedded images are dropped because GeoJSON has no standard way to carry them.

What if my KML has folders or MultiGeometry?

Folders are fine — every Placemark inside them is converted. Placemarks with multiple geometries produce one GeoJSON feature per geometry rather than a single multi-part feature.

Why did I get 'no readable coordinates'?

Placemarks were found but none contained parseable Point, LineString or Polygon coordinates — for example a KML with only GroundOverlays or network links. This tool converts vector geometry only.

Data sources & methodology