Spreadsheets & Data
KML to GeoJSON converter
Open a KML file and download it as GeoJSON. The same converter turns GeoJSON, KML, GPX and CSV coordinates into each other, shows what was kept and what was dropped, and flags latitude and longitude that look swapped.
or drop it here · GeoJSON, GPX and CSV work too
<Placemark> <name>Car park</name> <description>Start and finish</description> <Point><coordinates>11.4041,47.2692,574</coordinates></Point> </Placemark> <Placemark> <name>Lake loop</name> <styleUrl>#red</styleUrl> <ExtendedData>… difficulty: easy …</ExtendedData> <LineString><coordinates>11.4041,47.2692,574 11.40895,47.27118,579 11.41377,47.27006,583 11.4041,47.2692,574</coordinates></LineString> </Placemark>
{ "type": "FeatureCollection",
"features": [
{ "type": "Feature",
"properties": {
"name": "Car park",
"description": "Start and finish" },
"geometry": {
"type": "Point",
"coordinates": [11.4041, 47.2692, 574] } },
{ "type": "Feature",
"properties": { "name": "Lake loop" },
"geometry": {
"type": "LineString",
"coordinates": [
[11.4041, 47.2692, 574],
[11.40895, 47.27118, 579],
[11.41377, 47.27006, 583],
[11.4041, 47.2692, 574] ] } } ] }- Read as
- KML (detected), 2 features
- Geometry types
- 1 × LineString, 1 × Point
- Positions
- 5, elevation kept
- Output size
- 858 bytes
- Dropped or reshaped
- KML styles and ExtendedData are not carried over
- Coordinate check
- All 5 positions fall inside the valid range. Nothing looks swapped.
From KML to GeoJSON in three steps
- 1
Open or paste the file
Choose a KML, GeoJSON, GPX or CSV file, or paste the text. The format is detected from the file name or the content.
- 2
Pick the target format
GeoJSON, KML, GPX or CSV. For CSV input, pick the latitude and longitude columns. Headers such as lat, latitude, lon, lng and longitude are found on their own.
- 3
Check and download
The result panel lists features, geometry types, positions and anything that was dropped. Download the file or copy the output.
What changes when KML becomes GeoJSON
What is kept
Points, lines and polygons keep their coordinates. Each placemark's name and description become the name and description properties of a GeoJSON feature. Elevation stays when a position has one. Multi-part geometries are split into one feature per part. Coordinates are written with up to six decimal places, which is about 11 cm at the equator.
What is dropped
KML styles, icons, ExtendedData, network links, ground overlays, time spans and folder nesting have no place in plain GeoJSON, so they are left out. The result panel names what was dropped, so you are not surprised later in your map tool.
Coordinate order
KML and GeoJSON both write longitude first, so a KML to GeoJSON conversion keeps the order. GPX and most CSV exports write latitude first, which is where swaps happen. The coordinate check flags positions outside the valid range and marks pairs that look swapped. A swap box flips them before converting.
KMZ and other formats
A KMZ file is a zipped KML. Unzip it and open the KML inside. Shapefiles are not read here. Going the other way works too: GeoJSON to KML, GPX to GeoJSON, CSV to KML. GPX has no polygon type, so a polygon written to GPX becomes a track along its outer ring. CSV gets one row per vertex, with the feature and ring in their own columns.
Questions before you convert
Which formats can I convert?
GeoJSON, KML, GPX and CSV, from any of them to any other. Files ending in .json or .txt are read too when they hold one of these formats. A KMZ file is a zipped KML: unzip it first and open the KML inside. Shapefiles are not read here.
What happens to KML styles and extra fields when I convert to GeoJSON?
Geometry, coordinates, the name and the description are kept, and the name and description become GeoJSON properties. Elevation is kept when a position has it. KML styles, icons, ExtendedData, network links, ground overlays, time spans and folder nesting are dropped, and the result panel says so.
How large can the file be?
One file at a time, up to 20 MB. Larger files are not loaded, because the whole file has to sit in the browser's memory while it is converted.
How does it catch swapped latitude and longitude?
GeoJSON and KML write longitude first, GPX and most CSV exports write latitude first. The coordinate check lists every position outside the valid range and marks pairs whose latitude is outside plus or minus 90 but would be valid as a longitude. A swap box flips them before converting. When both values are small, a swap cannot be seen from the numbers alone.
Is my file uploaded?
No. The file is read and converted by your browser, and the download is created there too. The converter is free, needs no account and has no daily job limit.