Back to all posts

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

FeatureKMLGPXGeoJSON
Best ForGoogle Earth, visualizationGPS devices, outdoor appsWeb development, APIs
File TypeXML-basedXML-basedJSON-based
Styling SupportExcellent (icons, colors, labels)LimitedRequires separate layer
Route/Track SupportYesYes (primary purpose)Yes
3D SupportYes (altitude, tilt, heading)Elevation onlyLimited
Web IntegrationModeratePoorExcellent
File SizeLarger (verbose XML)MediumSmallest
Human ReadableModerateModerateMost readable
Learning CurveModerateEasyEasy (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:

FormatApproximate SizeParsing Speed
GeoJSON~15 KBFastest
GPX~25 KBMedium
KML~35 KBSlowest

Winner: GeoJSON - Its compact JSON structure makes it the most efficient for storage and transmission.

Application Support

ApplicationKMLGPXGeoJSON
Google EarthNativeImportImport
Google MapsNative--
Garmin DevicesLimitedNative-
OsmAndYesNativeYes
Organic Maps-Native-
Gaia GPSYesNativeYes
AllTrails-Native-
Leaflet.jsPluginPluginNative
MapboxYes-Native
QGISYesYesYes
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:

  1. GPX - Most apps handle it automatically
  2. KML - Google Earth makes it simple
  3. GeoJSON - Requires developer tools to view properly

For Developers:

  1. GeoJSON - Native JSON, easy to parse in any language
  2. GPX - Well-documented XML schema
  3. KML - Complex XML with many optional features

Feature Support

FeatureKMLGPXGeoJSON
Points/WaypointsYesYesYes
Lines/RoutesYesYesYes
Polygons/AreasYesLimitedYes
Custom IconsYesNoSeparate styling
Colors/StylesYesNoSeparate styling
3D/AltitudeYesYesLimited
Time DataYesYesCustom property
Custom MetadataYesExtensionsYes (flexible)
Folders/GroupsYesNoNo (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 GoalBest Format
View in Google EarthKML
Upload to Garmin deviceGPX
Use with OsmAnd/Organic MapsGPX
Build a web applicationGeoJSON
Share with non-technical friendsKML
Data analysis in QGISGeoJSON
Offline hiking navigationGPX
Create styled presentation mapsKML
Store in a databaseGeoJSON

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:

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

  1. Start with your destination app - Check what format your target application prefers before exporting. Most apps list supported formats in their import documentation.

  2. 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.

  3. 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.

  4. 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.

  5. 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:

See Other Export Guides

Want detailed instructions for a specific format?