Skip to main content
7BBusyBoss

KML to GeoJSON Converter: Clean RFC 7946 Output

Convert KML or KMZ to GeoJSON for Leaflet, Mapbox or QGIS. Standard RFC 7946 output with properties, colours and timestamps kept. Runs in your browser.

No limitsZero data leaksSuper fast

Drop your KML file

GPX, KML, KMZ and GeoJSON are all accepted, and several files at once merge into one. The file is read in your browser and never uploaded, which matters with GPS tracks: most of them start at someone's front door.

Drop .gpx, .kml, .kmz or .geojson files here, or

Convert to

Don't take our word for it — turn your wi-fi off.

This tool keeps working with no connection at all, because your file is processed here in the browser. A site that uploads your file cannot do that. Disconnect and try it — this box will notice.

Prefer to check properly? Open DevTools → Network, then run the tool. Your file appears in no request. Why none of our tools upload

You're on 7BusyBoss — 300+ free tools that run instantly in your browser. No signup, nothing uploaded.

Browse all Geo & Coordinate Converters →
About this tool

This KML to GeoJSON converter turns a .kml or .kmz from Google Earth, Google My Maps or a GIS into GeoJSON that loads in Leaflet, Mapbox GL, OpenLayers, D3, QGIS or a database. The output follows RFC 7946, the GeoJSON standard, and the conversion runs in your browser, so the file is not uploaded.

What each part of the KML becomes

In the KMLIn the GeoJSON
PlacemarkFeature
Point, LineString, PolygonThe same geometry type
MultiGeometry of one kindMultiPoint, MultiLineString or MultiPolygon
MultiGeometry of mixed kindsGeometryCollection
gx:Track with timesLineString, with the times in properties.coordTimes
name, descriptionproperties.name, properties.description
ExtendedData (Data or SchemaData)One property per field
LineStyle, PolyStyle, IconStyle coloursstroke, stroke-width, stroke-opacity, fill, fill-opacity, marker-color
FoldersFlattened: every placemark becomes a feature, folder names are not kept
Ground overlays, network links, 3D modelsSkipped and listed

The colour properties follow the simplestyle convention. A red KML line arrives as "stroke": "#ff0000", which geojson.io draws in red straight away and a Mapbox GL layer can pick up with ['get', 'stroke'].

Three things fixed on the way

  • Winding order. RFC 7946 asks for outer rings counter-clockwise and holes clockwise. KML has no rule, so rings are re-wound where needed. Validators such as geojsonhint flag rings that run the other way.
  • Closed rings. Every polygon ring ends with a copy of its first position, as GeoJSON requires.
  • Placeholder altitudes. Google Earth writes an altitude of 0 on shapes drawn on the ground. Those zeros are dropped, so positions are plain [lon, lat]. Real elevations, from a GPS track or an absolute-altitude path, stay as the third number.

Coordinates are rounded to 7 decimal places, about 1 cm, and the file is written one feature per line. It stays compact, opens in any text editor and diffs cleanly in Git, where a fully indented GeoJSON puts every number on a line of its own.

Worked example

Try an example loads a KML of a Triund trail sketch. It comes out as four features: two Points for the trailhead and the summit, which keep their elevations of 2,130 and 2,842 m as a third coordinate; a LineString of 10 positions with 10 matching coordTimes from 02:30 to 04:36 UTC; and a Polygon for the campsite meadow, whose closed ring of 5 positions is plain longitude and latitude because the meadow was drawn on the ground.

Using the result

In Leaflet, pass the parsed file to L.geoJSON(data). In Mapbox GL or MapLibre, add it with map.addSource('route', { type: 'geojson', data }). QGIS opens .geojson files directly. One caution: some libraries handle GeometryCollection poorly, so a placemark that mixed points and lines in Google Earth is easier to work with if you split it there first.

The reverse is GeoJSON to KML. For GPS devices use KML to GPX, and for a coordinate table, KML to CSV.

How to use the KML to GeoJSON Converter

Takes about a minute. No signup, no download, your data stays in your browser.

  1. 1
    Open the tool. Scroll up to the KML to GeoJSON Converter above — it loads instantly in your browser, no install needed.
  2. 2
    Enter your values. The fields come pre-filled with realistic defaults so you can see how it works — replace them with your own numbers.
  3. 3
    Read the result. The output updates instantly. Copy or share it — nothing is uploaded to a server, everything stays on your device.

Frequently asked questions

Common questions about the KML to GeoJSON Converter.

Is the output valid GeoJSON under RFC 7946?

Yes. It is a FeatureCollection with longitude-first WGS 84 coordinates, closed polygon rings, counter-clockwise outer rings and clockwise holes. Timestamps use the widely read coordTimes property, which the standard allows as an ordinary property.

What happens to the folders in my KML?

GeoJSON has no folders, so the structure is flattened and every placemark becomes one feature. Folder names are not kept. If you need them, put the folder name into each placemark name in Google Earth before converting.

Can I use the GeoJSON in Leaflet or Mapbox?

Yes. Load it with L.geoJSON(data) in Leaflet or as a geojson source in Mapbox GL and MapLibre. KML colours arrive as stroke and fill properties, which geojson.io draws as they are and a Mapbox GL style can read with a get expression.

Does it keep timestamps from a Google Earth track?

Yes. A timed gx:Track becomes a LineString with a coordTimes property listing one time per position, the same convention used by Mapbox's togeojson.

Is my KML file uploaded?

No. The KML, or the KML inside a KMZ, is read and converted in your browser tab. Nothing is sent to a server.

Community rating

Discussion (0)

No comments yet. Start the discussion.