{
  "slug": "kml-to-geojson",
  "name": "gizza-ai/kml-to-geojson",
  "version": "0.1.0",
  "title": "KML to GeoJSON Converter (and GeoJSON back to KML) — gizza.ai",
  "description": "Convert KML or KMZ map data into GeoJSON — or GeoJSON back into KML — entirely in your browser. Free, private, no upload, no account.",
  "tags": [
    "kml to geojson",
    "kmz to geojson",
    "geojson to kml",
    "kml converter",
    "google earth to geojson",
    "map data converter"
  ],
  "category": "data",
  "urls": {
    "page": "https://gizza.ai/tools/kml-to-geojson/",
    "markdown": "https://gizza.ai/tools/kml-to-geojson/index.md",
    "descriptor": "https://gizza.ai/tools/kml-to-geojson/tool.json",
    "deep_link_example": "https://gizza.ai/tools/kml-to-geojson/?input=%3Ckml%20xmlns%3D%27http%3A%2F%2Fwww.opengis.net%2Fkml%2F2.2%27%3E%3CDocument%3E%3CFolder%3E%3Cname%3ETrails%3C%2Fname%3E%3CPlacemark%3E%3Cname%3ETrailhead%3C%2Fname%3E%3CPoint%3E%3Ccoordinates%3E-122.084%2C37.421%2C15%3C%2Fcoordinates%3E%3C%2FPoint%3E%3C%2FPlacemark%3E%3C%2FFolder%3E%3C%2FDocument%3E%3C%2Fkml%3E&output_format=geojson&include_styles=true&include_folders=true&precision=6&document_name=Weekend%20Trip&altitude_mode=clamp_to_ground"
  },
  "cli": "gizza tool kml-to-geojson \"<kml xmlns='http://www.opengis.net/kml/2.2'><Document><Folder><name>Trails</name><Placemark><name>Trailhead</name><Point><coordinates>-122.084,37.421,15</coordinates></Point></Placemark></Folder></Document></kml>\"",
  "tool": {
    "description": "Convert KML or KMZ map data into GeoJSON, or GeoJSON back into KML. KML/KMZ -> GeoJSON: each Placemark's Point/LineString/Polygon becomes the matching GeoJSON geometry and MultiGeometry becomes a GeometryCollection; name/description become properties, ExtendedData/SimpleData become arbitrary properties, TimeSpan/TimeStamp become begin/end/time properties, the <Folder> path becomes a 'folder' property (include_folders=true, the default), and inline or shared Style/styleUrl/StyleMap colors and line widths become simplestyle-spec properties (stroke, stroke-width, stroke-opacity, fill, fill-opacity, marker-color) when include_styles=true (the default). A KMZ is a zip archive, so pass it base64-encoded (it is detected by its 'UEsD' prefix) and its doc.kml — or first .kml — entry is converted. Set output_format=kml to go the other way: Point/LineString/Polygon become the matching KML geometry, MultiPoint/MultiLineString/MultiPolygon/GeometryCollection become a MultiGeometry, name/description become <name>/<description>, every other property becomes ExtendedData, simplestyle properties become an inline Style, the 'folder' property rebuilds the <Folder> tree, and document_name/altitude_mode set the <Document> name and <altitudeMode>. The precision parameter rounds every coordinate in both directions (default 6 decimal places). Both formats are WGS84, so no reprojection happens. Input is capped at 2 MB. Runs fully locally, no network access.",
    "parameters": {
      "additionalProperties": false,
      "properties": {
        "altitude_mode": {
          "default": "clamp_to_ground",
          "description": "GeoJSON -> KML only: how KML should read a position's third (altitude) value. 'clamp_to_ground' (default) drapes geometry on the terrain, 'relative_to_ground' treats altitude as height above the terrain, and 'absolute' treats it as height above sea level. Ignored when output_format=geojson.",
          "enum": [
            "clamp_to_ground",
            "relative_to_ground",
            "absolute"
          ],
          "type": "string"
        },
        "document_name": {
          "default": "GeoJSON Export",
          "description": "GeoJSON -> KML only: the <name> written on the KML <Document>, which is what Google Earth shows in its Places list. Blank falls back to 'GeoJSON Export'. Ignored when output_format=geojson.",
          "type": "string"
        },
        "include_folders": {
          "default": true,
          "description": "Carry the <Folder> hierarchy across. KML -> GeoJSON: each feature gets a 'folder' property holding its slash-separated folder path (e.g. 'Trails/Day 1'). GeoJSON -> KML: features are regrouped into nested <Folder> elements from that property. Default true.",
          "type": "boolean"
        },
        "include_styles": {
          "default": true,
          "description": "Carry styling across. KML -> GeoJSON: fold each Placemark's inline or shared Style/styleUrl/StyleMap into simplestyle-spec properties (stroke, stroke-width, stroke-opacity, fill, fill-opacity, marker-color). GeoJSON -> KML: turn those same properties back into an inline Style (LineStyle/PolyStyle/IconStyle). Default true.",
          "type": "boolean"
        },
        "input": {
          "description": "The map data to convert: KML XML text, a base64-encoded KMZ archive (detected by its 'UEsD' prefix — the doc.kml entry, or the first .kml entry, is used), or a GeoJSON document (FeatureCollection, Feature, or bare geometry) when output_format=kml. Up to 2 MB.",
          "type": "string"
        },
        "output_format": {
          "default": "geojson",
          "description": "Direction to convert. 'geojson' (default) turns KML/KMZ into a GeoJSON FeatureCollection: Placemark Point/LineString/Polygon become the matching geometry, MultiGeometry becomes a GeometryCollection, and name/description/ExtendedData/TimeSpan/TimeStamp become properties. 'kml' turns GeoJSON back into a KML document.",
          "enum": [
            "geojson",
            "kml"
          ],
          "type": "string"
        },
        "precision": {
          "default": 6,
          "description": "Decimal places kept on every longitude/latitude/altitude, in both directions. 6 (the default) is about 0.1 m; 5 is about 1 m and makes a noticeably smaller file; 0 rounds to whole degrees. Range 0-15.",
          "maximum": 15,
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "input"
      ],
      "type": "object"
    }
  }
}