Google Maps to GPX Converter
Convert Google Maps URLs, directions, and KML files to GPX format. Extract waypoints, routes, and tracks for GPS devices and apps.
About
GPS Exchange Format (GPX) remains the universal standard for transferring geospatial data between devices and software. Google Maps does not export GPX natively. This tool parses Google Maps URLs - including directions with multiple waypoints, shared place links, and coordinate-embedded URLs - to extract latitude/longitude pairs and convert them into valid GPX 1.1 XML. It also accepts KML file uploads for direct conversion. Coordinate precision is preserved to 6 decimal places, yielding positional accuracy of approximately 0.11 m. The tool approximates route geometry from available URL data; Google Maps encodes polylines in a proprietary format, so extracted tracks represent point-to-point segments rather than turn-by-turn paths. For full route fidelity, export KML from Google My Maps and upload it here.
Formulas
GPX files conform to the GPX 1.1 XML schema defined by Topografix. Each waypoint is encoded as:
Where φ is latitude in decimal degrees (−90 ≤ φ ≤ 90) and λ is longitude (−180 ≤ λ ≤ 180). Coordinate extraction from URLs uses pattern matching against known Google Maps URL structures. The primary regex for coordinate extraction:
For distance between extracted points, the Haversine formula is applied for display metadata:
Where R = 6371 km (mean Earth radius), φ = latitude in radians, λ = longitude in radians.
Reference Data
| Google Maps URL Pattern | Data Extracted | GPX Element | Example |
|---|---|---|---|
| /@lat,lng,zoom | Single coordinate (map center) | <wpt> | /@48.8566,2.3522,15z |
| /place/Name/@lat,lng | Named place + coordinate | <wpt> with <name> | /place/Eiffel+Tower/@48.8584,2.2945 |
| /dir/Origin/Destination | Start + End coordinates | <rte> with <rtept> | /dir/Paris/Lyon |
| /dir/A/B/C/D | Multi-stop route | <rte> with multiple <rtept> | /dir/Paris/Dijon/Lyon/Marseille |
| !3d(lat)!4d(lng) | Embedded coordinates | <wpt> | !3d48.8566!4d2.3522 |
| q=lat,lng | Search query coordinate | <wpt> | ?q=48.8566,2.3522 |
| KML file upload | All placemarks + paths | <wpt> / <trk> | .kml file from My Maps |
| ll=lat,lng | Linked location | <wpt> | ?ll=48.8566,2.3522 |
| saddr= / daddr= | Legacy directions | <rte> | ?saddr=Paris&daddr=Lyon |
| data=!3m1!4b1!...!3d!4d | Deep-linked data coordinates | <wpt> | Long data parameter strings |
| /search/query/@lat,lng | Search area center | <wpt> | /search/restaurants/@48.85,2.35 |
| Coordinates in text | Raw lat,lng pairs | <wpt> | 48.8566, 2.3522 |