All converters
HomeKML & KMZ converter › KML to GeoJSON

Convert KML to GeoJSON

By , GIS & remote-sensing practitioner · Reviewed

Convert KML to GeoJSON and reuse Google Earth layers in web apps, JavaScript libraries and modern APIs. The translation is performed by WebAssembly in this page, so nothing you drop here is uploaded.

Drop a file here, or click to browse

KML, KMZ, SHP (.zip), GeoJSON, GPKG, GML, GPX, DXF, CSV, Excel, and more

No uploadNo trackingOpen standards (GDAL/OGR)Works offline once loaded

No KML file to hand? Download a sample KML file (100 points) and drop it above to see the conversion.

How to convert KML to GeoJSON

  1. Drop the .kml file into the box above.
  2. Folders and placemarks are read into features you can check on the preview map.
  3. Choose GeoJSON, click Convert, and get a clean FeatureCollection in WGS84, ready for Leaflet or Mapbox.

What changes when you convert KML to GeoJSON

Every format stores different things, so a conversion is never perfectly loss-free. Here is exactly what carries over when you convert KML to GeoJSON, and what to watch for.

WhatKML → GeoJSON
GeometryKeptPoints, lines and polygons are preserved exactly, including multi-part shapes.
AttributesKeptEvery column and full field name moves from KML into GeoJSON untouched.
Styling & labelsDroppedKML colours, icons and description balloons are presentation, not data. GeoJSON stores the underlying features, so styling is dropped (the geometry and attributes remain).
Coordinate systemChangesGeoJSON is defined in WGS84 (EPSG:4326), so data is reprojected to lon/lat on the way out.
Elevation (Z)Kept3D Z values carry from KML into GeoJSON wherever the source records them.
File structureKeptA single, self-contained .geojson file you can move around on its own.

Why convert KML to GeoJSON?

KML is what Google Earth and Google Maps produce, so field data, placemarks and drawn paths often start life there. GeoJSON, however, is what the web-mapping stack actually reads. So people convert KML to GeoJSON to move a map off Google Earth and into Leaflet, Mapbox GL or OpenLayers. The result is a plain-text JSON structure you can pass straight through a web API, or commit to Git and track line by line. In short, KML captures the map, then GeoJSON makes it programmable for modern web apps and scripts.

Coordinate system handling

KML is already defined in WGS84 longitude/latitude (EPSG:4326), so no guessing is needed on the way in.

GeoJSON is defined in WGS84 (EPSG:4326), so the output is reprojected to longitude/latitude, exactly what Google Earth and web maps expect. A quick CRS check before you download saves the classic "my KML data is in the wrong place" surprise; the guide on coordinate systems and EPSG codes goes deeper.

What to check when converting KML to GeoJSON

Both formats use WGS84 lon/lat, so coordinates line up cleanly. The real thing to check is styling. KML stores colors, icons and label styling inline, but RFC 7946 GeoJSON has no styling model. So placemark icons and line colors are dropped, and only geometry plus attributes survive. Also confirm your KML placemark data lands in GeoJSON properties, since that is where Leaflet and Mapbox read it.

Which software opens the result

KML files typically come out of Google Earth, Google Maps, QGIS, ArcGIS. Once you convert to GeoJSON, the file opens in web maps built on Leaflet, Mapbox GL or OpenLayers, and desktop tools like QGIS. The GeoJSON output follows the standard specification exactly, so those programs read it without any special import settings.

Troubleshooting KML to GeoJSON

About the formats

Most KML starts life in Google Earth, where placemarks and paths get drawn by hand or exported from a shared map. GeoJSON is where that same geometry becomes web-ready. Converting here strips the Google Earth styling wrapper and hands you clean features that Leaflet, Mapbox GL or OpenLayers can render straight away. In practice you draw once in Earth, then convert so the data drops into a slippy map or an API response.

Frequently asked questions

Does KML to GeoJSON keep my placemark names and descriptions?

Yes. Placemark names, descriptions and other data become GeoJSON feature properties, which is exactly where Leaflet and Mapbox look for attribute values. The geometry and its lon/lat coordinates carry over unchanged.

Why did my KML icon colors and styles disappear in the GeoJSON?

RFC 7946 GeoJSON has no styling model, so inline KML styles like icons, colors and labels are not represented. You reapply appearance in your web map code, for example by setting Leaflet or Mapbox styles based on a property value.

What happens to the styling and folders inside my KML?

GeoJSON is a plain geometry-and-attributes format, so KML styling like icon colors, line widths and balloon HTML is not carried across. Folder structure is flattened into a single feature collection. The coordinates and named descriptions come through, but you re-apply styling in Leaflet or Mapbox afterward.

Does the altitude value in my KML placemarks survive?

KML often stores a third coordinate for altitude. That Z value is preserved in the GeoJSON position array, since the spec allows a third element. Many web renderers like Leaflet simply ignore it and plot the point in 2D, so the extra number sits in the data without affecting the map.

What can open a GeoJSON file after converting?

A GeoJSON file opens in web maps (Leaflet, Mapbox, OpenLayers) and QGIS. Because the output follows the standard specification, any tool that supports GeoJSON will read it without special settings.

Does converting KML to GeoJSON lose any data?

No conversion is perfectly loss-free because each format stores different things, but Google Earth styling (colours and icons) is dropped because GeoJSON stores the underlying data, not its presentation; the placemarks and their information are kept.

Related converters

Related reading