KML vs GPX vs GeoJSON: Which Format Should You Use?
Compare KML, GPX, and GeoJSON formats for location data. Learn which format works best for Google Earth, GPS devices, web maps, and more.
January 13, 2026
•10 min read
Choosing the right format for your location data can be confusing. KML, GPX, and GeoJSON each have their strengths, and picking the wrong one means extra conversion work or lost features. This guide breaks down exactly when to use each format so you can make the right choice the first time.
Quick Comparison Table
| Feature | KML | GPX | GeoJSON |
|---|---|---|---|
| Best For | Google Earth, visualization | GPS devices, outdoor apps | Web development, APIs |
| File Type | XML-based | XML-based | JSON-based |
| Styling Support | Excellent (icons, colors, labels) | Limited | Requires separate layer |
| Route/Track Support | Yes | Yes (primary purpose) | Yes |
| 3D Support | Yes (altitude, tilt, heading) | Elevation only | Limited |
| Web Integration | Moderate | Poor | Excellent |
| File Size | Larger (verbose XML) | Medium | Smallest |
| Human Readable | Moderate | Moderate | Most readable |
| Learning Curve | Moderate | Easy | Easy (for developers) |
What is KML?
KML (Keyhole Markup Language) is an XML-based format originally developed for Google Earth. It's now an international standard maintained by the Open Geospatial Consortium (OGC).
KML Structure Example
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<name>My Saved Places</name>
<Style id="customStyle">
<IconStyle>
<Icon><href>https://example.com/icon.png</href></Icon>
</IconStyle>
</Style>
<Folder>
<name>Restaurants</name>
<Placemark>
<name>My Favorite Cafe</name>
<description>Best coffee in town</description>
<styleUrl>#customStyle</styleUrl>
<Point>
<coordinates>-122.4194,37.7749,0</coordinates>
</Point>
</Placemark>
</Folder>
</Document>
</kml>
KML Strengths
- Rich visualization: Custom icons, colors, labels, and polygon fills
- 3D capabilities: Altitude, camera angles, and virtual tours
- Folder organization: Group places into hierarchical categories
- Google ecosystem: Native support in Google Earth and Google Maps
- Multimedia: Embed images, links, and HTML descriptions
Best Use Cases for KML
- Viewing saved places in Google Earth
- Creating presentation-quality maps
- Sharing visually styled location data
- Building virtual tours and fly-throughs
- Archiving location data with rich metadata
Want to export to KML? See our complete KML export guide.
What is GPX?
GPX (GPS Exchange Format) is an XML schema designed specifically for GPS data. It's the universal standard for exchanging waypoints, tracks, and routes between GPS devices and software.
GPX Structure Example
<?xml version="1.0" encoding="UTF-8"?>
<gpx version="1.1" creator="Takeout-Tools.com"
xmlns="http://www.topografix.com/GPX/1/1">
<metadata>
<name>My Saved Places</name>
<time>2026-01-13T12:00:00Z</time>
</metadata>
<wpt lat="37.7749" lon="-122.4194">
<ele>10</ele>
<name>My Favorite Cafe</name>
<desc>Best coffee in town</desc>
<type>Restaurant</type>
</wpt>
</gpx>
GPX Strengths
- Universal GPS compatibility: Works with virtually every GPS device
- Outdoor app support: Native format for Garmin, OsmAnd, Gaia GPS, AllTrails
- Track recording: Designed for recording routes with timestamps
- Elevation data: Built-in support for altitude information
- Simplicity: Straightforward structure, easy to understand
Best Use Cases for GPX
- Loading waypoints onto Garmin or other GPS devices
- Importing into hiking/cycling apps like OsmAnd or Gaia GPS
- Sharing routes with outdoor enthusiasts
- Offline navigation in areas without cell service
- Fitness tracking and activity logging
Want to export to GPX? See our complete GPX export guide.
What is GeoJSON?
GeoJSON is an open standard format based on JSON for representing geographic features. It's the preferred format for web developers and modern mapping applications.
GeoJSON Structure Example
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"name": "My Favorite Cafe",
"description": "Best coffee in town",
"category": "Restaurant"
},
"geometry": {
"type": "Point",
"coordinates": [-122.4194, 37.7749]
}
}
]
}
GeoJSON Strengths
- Web-native: Works seamlessly with JavaScript and web APIs
- Lightweight: Smallest file size of the three formats
- Flexible properties: Store any custom data alongside coordinates
- Library support: Native support in Leaflet, Mapbox, D3.js, and more
- API friendly: Easy to parse, generate, and transmit over HTTP
Best Use Cases for GeoJSON
- Building custom web maps with Leaflet or Mapbox
- Integrating location data into web applications
- Data analysis with tools like Kepler.gl or QGIS
- Storing location data in databases
- Building location-aware APIs and services
Want to export to GeoJSON? See our complete GeoJSON export guide.
Detailed Comparison
File Size and Complexity
When dealing with large datasets, file size matters. Here's how the formats compare for 100 waypoints:
| Format | Approximate Size | Parsing Speed |
|---|---|---|
| GeoJSON | ~15 KB | Fastest |
| GPX | ~25 KB | Medium |
| KML | ~35 KB | Slowest |
Winner: GeoJSON - Its compact JSON structure makes it the most efficient for storage and transmission.
Application Support
| Application | KML | GPX | GeoJSON |
|---|---|---|---|
| Google Earth | Native | Import | Import |
| Google Maps | Native | - | - |
| Garmin Devices | Limited | Native | - |
| OsmAnd | Yes | Native | Yes |
| Organic Maps | - | Native | - |
| Gaia GPS | Yes | Native | Yes |
| AllTrails | - | Native | - |
| Leaflet.js | Plugin | Plugin | Native |
| Mapbox | Yes | - | Native |
| QGIS | Yes | Yes | Yes |
| Kepler.gl | - | - | Native |
Winner: It depends - GPX wins for outdoor/GPS apps, GeoJSON wins for web development, KML wins for Google ecosystem.
Ease of Use
For Non-Technical Users:
- GPX - Most apps handle it automatically
- KML - Google Earth makes it simple
- GeoJSON - Requires developer tools to view properly
For Developers:
- GeoJSON - Native JSON, easy to parse in any language
- GPX - Well-documented XML schema
- KML - Complex XML with many optional features
Feature Support
| Feature | KML | GPX | GeoJSON |
|---|---|---|---|
| Points/Waypoints | Yes | Yes | Yes |
| Lines/Routes | Yes | Yes | Yes |
| Polygons/Areas | Yes | Limited | Yes |
| Custom Icons | Yes | No | Separate styling |
| Colors/Styles | Yes | No | Separate styling |
| 3D/Altitude | Yes | Yes | Limited |
| Time Data | Yes | Yes | Custom property |
| Custom Metadata | Yes | Extensions | Yes (flexible) |
| Folders/Groups | Yes | No | No (flat structure) |
Winner: KML - Most feature-rich for visualization; GeoJSON - Most flexible for custom data.
Which Format Should You Choose?
Use this decision tree to find your best format:
Choose KML if you want to:
- View your places in Google Earth
- Create visually styled maps with custom icons
- Build virtual tours or presentations
- Share maps with non-technical users who use Google products
- Preserve folder organization from Google Maps lists
Choose GPX if you want to:
- Load places onto a Garmin or other GPS device
- Use outdoor navigation apps (OsmAnd, Gaia GPS, AllTrails)
- Go hiking, cycling, or camping with your saved places
- Have offline access in areas without cell service
- Share routes with outdoor enthusiasts
Choose GeoJSON if you want to:
- Build a custom web map or application
- Use modern mapping libraries like Leaflet or Mapbox
- Perform data analysis or visualization
- Store location data in a database
- Work with APIs or integrate with other software
Quick Decision Matrix
| Your Goal | Best Format |
|---|---|
| View in Google Earth | KML |
| Upload to Garmin device | GPX |
| Use with OsmAnd/Organic Maps | GPX |
| Build a web application | GeoJSON |
| Share with non-technical friends | KML |
| Data analysis in QGIS | GeoJSON |
| Offline hiking navigation | GPX |
| Create styled presentation maps | KML |
| Store in a database | GeoJSON |
Can You Convert Between Formats?
Yes, absolutely. All three formats contain the same core geographic data (coordinates and metadata), so conversion between them is straightforward.
Already have a geo file? Use our free online converters to convert between formats instantly in your browser:
- GPX to KML, GPX to GeoJSON, GPX to CSV
- KML to GPX, KML to GeoJSON, KML to CSV
- GeoJSON to GPX, GeoJSON to KML, GeoJSON to CSV
Starting from Google Takeout? Takeout Tools handles the geocoding step that Google doesn't provide - upload your Google Takeout CSV files and export to any format with coordinates included.
This flexibility means you don't have to choose just one. Export to GPX for your Garmin, KML for Google Earth, and GeoJSON for your web project - all from the same source data.
Pro Tips
-
Start with your destination app - Check what format your target application prefers before exporting. Most apps list supported formats in their import documentation.
-
GeoJSON for archival - If you're unsure which format you'll need later, GeoJSON is the most future-proof choice. Its simple structure and widespread support mean it's unlikely to become obsolete.
-
Use KML folders wisely - When exporting to KML, your Google Maps lists become folders. This organization is lost when converting to GPX or GeoJSON, so export to KML first if folder structure matters.
-
Check coordinate order - GeoJSON uses [longitude, latitude] order, while KML and GPX use latitude first (or as separate attributes). This trips up many developers when switching formats.
-
Test with a small sample - Before exporting hundreds of places, test with 5-10 to make sure your target app handles the data correctly. This saves time troubleshooting large files.
Frequently Asked Questions
Can I open a KML file in a GPS device like Garmin?
Some newer Garmin devices support KML, but GPX is the native format and works more reliably. For the best compatibility with any GPS device, convert your KML to GPX before uploading.
Which format preserves the most information from Google Maps?
KML preserves the most structural information because it supports folders (your Google Maps lists) and rich descriptions. However, all three formats preserve the essential data: place names, coordinates, and descriptions.
Is GeoJSON better than KML for web maps?
Yes, for most web mapping scenarios. GeoJSON is native to JavaScript, making it much easier to work with in libraries like Leaflet and Mapbox. KML requires additional parsing libraries and doesn't integrate as smoothly with modern web frameworks.
Can I use GPX files for car navigation?
GPX is primarily designed for outdoor activities, but some car GPS systems support it for waypoints. For car navigation, you might get better results importing directly into your navigation app (Google Maps, Waze, etc.) rather than using GPX files.
What format should I use for backing up my Google Maps places?
For long-term backup, GeoJSON is recommended because it's a simple, open standard that any programming language can read. KML is also a good choice if you want to preserve your list organization. Export to multiple formats if storage space isn't a concern.
Export to Any Format
Get your saved places in KML, GPX, GeoJSON, or CSV
Try Takeout Tools →
Free Tools
Validate or convert your geo files instantly in your browser:
Validators - Check your files for errors and data quality issues:
Converters - Convert between any format:
- All converters - GPX, KML, GeoJSON, and CSV
See Other Export Guides
Want detailed instructions for a specific format?