KML/GPX to GeoJSON
Convert a GPX (waypoints/tracks/routes) or KML (Placemarks: Point/LineString/Polygon) file to GeoJSON. A hand-rolled tag scan, not a general XML parser: no styles, nested Folder hierarchy, MultiGeometry, or extended data. Runs on your device.
Runs on your device. The file is never uploaded.
KML/GPX to GeoJSON reads a GPX or KML file and prints one FeatureCollection. Each waypoint and KML Point becomes a Point carrying its name; track segments, routes and KML LineStrings become LineStrings; a Polygon keeps only its outer ring. Height is dropped everywhere: no elevation tag and no third coordinate reaches the output.
Questions
Which files can I drop in?
GPX or KML, as plain XML text. The tool looks for a kml or gpx root element and picks its parser from that; finding neither, it stops and asks whether the file is GPX or KML. KMZ is not handled, because it is a zip archive: unzip it and drop the doc.kml from inside.
What does it pull out of a GPX file?
Waypoints, tracks and routes. Each waypoint becomes a Point feature, carrying its name as a property when it has one. Each track segment becomes one LineString, and each route becomes a LineString built from its route points. Track and route features get no properties, and elevation is not carried into the output.
What does it pull out of a KML file?
Placemarks. Each becomes a feature with its name as a property and one geometry: a Point, a LineString or a Polygon, tried in that order when more than one is present. Styles, folder hierarchy, MultiGeometry and ExtendedData are all ignored, and the altitude in a coordinate triplet is dropped.
Why did my file come back empty?
The scan looks for specific tag shapes rather than parsing the XML properly, so attribute order matters: a waypoint has to be written with lat before lon, as the format normally does. Files that nest their coordinates differently, or that carry data only in extensions, produce nothing and stop with "no recognizable waypoints/tracks/placemarks found".
What does the output look like?
A single GeoJSON FeatureCollection, pretty printed with two-space indentation and shown as text on the page. Coordinates are written in GeoJSON order, longitude first and latitude second, which is the reverse of how GPX writes its attributes. Drop several files and you get one collection printed per file.
Does the file get uploaded to convert it?
No. The file is read into this tab and scanned inside a Web Worker. GPS traces are among the most personal files anyone converts, since a track shows where you live and when you were out, and this one never leaves your device. No request is made, and the page works with the network off.