GeoJSON to KML Converter: Web Data into Google Earth

All tools
Report

Heading to the field? Install this site from your browser menu and this tool works with no signal. See how

Converter

Nothing is uploaded. The file is converted on your own device, so it works with no signal.

Drop a file here or

Nothing leaves your device.

No file to hand?

Waiting for a file.

Features in this file

NameTypeFolderVerticesLengthArea

A comparison showing a GeoJSON properties object holding name, depth and contractor, alongside the KML placemark it becomes. The name property becomes the placemark label written on the map. The depth and contractor properties become ExtendedData, which is what appears when somebody clicks the point. A band explains that GeoJSON carries no styling and neither does the resulting KML, so everything will be the same default colour and icon unless styling is set in Google Earth afterwards. A second panel notes that nested properties are flattened to text because ExtendedData holds a single value.
The point of this conversion is the right hand column. GeoJSON hides its attributes from people; Google Earth puts them behind a click.

How to use this tool

Drop a .geojson or .json file above. A FeatureCollection, a single Feature, a bare geometry or a plain array all work. Press Convert to KML and the result opens in Google Earth by double clicking.

If you would rather send one compressed file, convert to KML here and then use the KMZ tools, or start from a spreadsheet with the CSV to KML Converter.

Why anybody does this

GeoJSON is a developer format. It is what an API returns and what a web map consumes, and it is close to unreadable as a file. KML is what you send to somebody who wants to look at the data rather than program against it.

The practical difference is the balloon. GeoJSON hides its attributes inside a properties object that only software reads. Google Earth turns those same attributes into something a person clicks on. A field engineer, a client or a planning officer can interrogate the map without knowing what JSON is.

What happens to your properties

A property called name becomes the placemark name, which is the label written on the map and shown in the sidebar. Every other property becomes ExtendedData, which is what appears in the balloon.

Nested properties are the exception. GeoJSON lets a property hold an object or an array, and KML ExtendedData holds a single value, so anything nested is written as text. It stays readable in the balloon and it stops being structured.

One thing you have to add yourself: styling. GeoJSON carries none, so the KML that comes out of it has none either, and every feature will be the same default colour and icon. If your data is classified by a property, set the styling in Google Earth after importing. Without that, the map shows position and nothing else at a glance.

A worked check you can repeat on paper

Convert the sample and open the result in a text editor. The arithmetic is quick and it confirms nothing was dropped.

  • Count the properties on one feature in the source GeoJSON.
  • Find the matching Placemark in the KML. One property became the name element.
  • Count the Data elements inside its ExtendedData block. That count should be the number of properties minus one.

If it is short by more than one, something was dropped, and the usual reason is an empty value. Properties with null or empty values are skipped rather than written as blank fields, which keeps the balloon readable but does mean the counts differ on rows with gaps.

Mistakes that catch people out

Expecting your web map colours to come with it. They live in your mapping code, not in the GeoJSON.

Assuming Google Earth will render HTML in a property. Some of it, sometimes, depending on the version. Do not rely on it.

Sending a huge KML rather than a KMZ. A KML of any size compresses dramatically, so zip it or convert to KMZ before emailing.

Losing numeric precision by rounding in the source. The conversion writes what it is given.

Forgetting that a bare geometry has no properties at all, so the resulting placemark has no name and no balloon. That is the input, not the conversion.

Related Calculators and Reference

Turning developer data into something a person can click is usually the last step.