Sport-Calculator.comSport-Calculator.com
Tools4 min read

Complete Guide to KML Files: Everything You Need to Know

What is a KML file? Comprehensive guide to Keyhole Markup Language, how to open, edit, and convert KML files for Google Earth and GPS.

What is a KML file? KML (Keyhole Markup Language) is an XML-based file format used to display geographic data in Earth browsers such as Google Earth, Google Maps, and other mapping software. It stores locations, routes, and overlays with rich visualization capabilities.

Created originally for Keyhole Earth Viewer (which became Google Earth), KML is now an international standard maintained by the Open Geospatial Consortium (OGC).

What KML Files Contain

Unlike basic GPS formats, KML focuses on visualization. A single file can contain:

Placemarks

Points of interest marked with icons and labels:

  • Exact coordinates (latitude/longitude/altitude)
  • Custom icons and styles
  • Descriptions (HTML supported)
  • View angles (Camera views)

Paths and Polygons

Lines and shapes drawn on the map:

  • Routes (LineStrings) with color and width styling
  • Areas (Polygons) with fill colors
  • 3D extrusions (buildings, walls)

Overlays

Visual layers added to the map:

  • Ground overlays (images draped over terrain)
  • Screen overlays (logos, legends)
  • Photo overlays

KML File Structure

KML is text-based XML, making it human-readable. Here's a simple example:

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
  <Placemark>
    <name>Simple Placemark</name>
    <description>Attached to the ground.</description>
    <Point>
      <coordinates>-122.0822035425683,37.42228990140251,0</coordinates>
    </Point>
  </Placemark>
</kml>

KML vs Other Formats

How does KML compare to other common GPS formats?

FeatureKMLGPXKMZFIT
Primary UseGoogle EarthGPS DevicesGoogle EarthGarmin Devices
FormatXML (Text)XML (Text)Zipped KMLBinary
Styling✅ Rich❌ Basic✅ Rich❌ None
File SizeMediumMediumSmallSmall
Navigation❌ Limited✅ Best❌ Limited✅ Good

For a deeper dive, see our KML vs GPX Format Comparison.

How to Create KML Files

Google Earth Pro

  1. Right-click "My Places"
  2. Add > Placemark / Path / Polygon
  3. Right-click the item and select "Save Place As..."
  4. Choose "Kml" format

Google My Maps

  1. Create a new map and add points
  2. Click the three dots menu
  3. Select "Export to KML/KMZ"

From Other Formats

Use our converters to turn your GPS data into KML:

How to View KML Files

Desktop Applications

  • Google Earth Pro: The gold standard for KML viewing
  • ArcGIS / QGIS: Professional GIS software
  • Marble: Open-source virtual globe

Web Viewers

  • Google Earth Web: View directly in Chrome
  • Google Maps: Can import simple KML files
  • KML Viewer Online: Various free web tools

How to Convert KML Files

To use KML data on GPS devices, you usually need to convert it to GPX.

Tool: KML to GPX Converter

This is essential for:

  • Hiking with a Garmin handheld
  • Cycling with a Wahoo/Hammerhead
  • Running with a Coros/Suunto watch

See our guide: How to Convert KML to GPX

Common KML Issues

File Too Large

KML files are text and can get huge. Solution: Save as KMZ (compressed KML) or simplify the geometry.

Not Showing on GPS

Most GPS units don't read KML. Solution: Convert to GPX first.

Missing Textures/Icons

If a KML links to local images on your computer, they won't show for others. Solution: Use KMZ format which bundles images inside the file.

Converters

Guides

Disclaimer: Information provided by this site is for educational purposes only and is not intended to be a substitute for professional medical advice specific to the reader's particular situation. The information is not to be used for diagnosing or treating any health concerns you may have. The reader is advised to seek prompt professional medical advice from a doctor or other healthcare practitioner about any health question, symptom, treatment, disease, or medical condition.