A KML file stores location data in a format that mapping programs can read

A KML file is a text document that holds geographic information — points on a map, lines, shapes, and the details attached to them. KML stands for Keyhole Markup Language. The file itself is plain text written in a specific structure that mapping software recognizes. When you open a KML file in the right program, you see those locations displayed on a map instead of raw code.

You might encounter KML files when you download map data from Google Maps, export locations from a GPS device, or receive map information from someone else. The file extension is .kml. Because KML is a standard format, many different programs can read it — Google Earth, Google Maps, ArcGIS, and dozens of other mapping tools all understand KML files without needing conversion.

The practical reason KML exists is portability. If you mark locations in one mapping program and want to use them in another, KML lets you move that data without losing the information. A researcher might export field sites as a KML file from one tool and import it into another. A business might share store locations with partners by sending a KML file. The format preserves coordinates, names, descriptions, and styling choices.

Key Takeaways

  • A KML file is a text document containing map locations and geographic shapes that mapping software can display visually.
  • KML files are created when you export or download location data from Google Maps, GPS devices, or other mapping programs.
  • Most mapping software — Google Earth, Google Maps, ArcGIS — can open KML files directly without conversion.
  • KML files are useful for moving location data between different programs and for sharing maps with other people.

How KML files are created

You usually do not write KML code yourself. Instead, mapping programs create KML files when you ask them to export or save your work. In Google Maps, you can create a custom map, mark locations on it, and then download that map as a KML file. In Google Earth, you can save placemarks and folders as KML. GPS devices often let you export recorded tracks and waypoints as KML files.

Some programs also let you create a KML file by uploading location data in other formats. If you have a spreadsheet with addresses or coordinates, certain mapping tools can convert that into a KML file. The conversion process reads your data and structures it into the KML format so mapping software can understand it.

Opening and using a KML file

To view a KML file, you need a program that reads geographic data. Google Earth is free and handles KML files well — you can open a KML file directly in Google Earth and see all the locations displayed on a 3D globe. Google Maps also accepts KML files; you can import one into a custom map and continue editing it there.

Other options include ArcGIS (used by professionals for detailed mapping work), QGIS (free and open-source), or specialized GPS software. Many web-based mapping tools accept KML uploads as well. The process is usually straightforward: open the program, find an import or open option, select your KML file, and the locations appear on the map.

Once a KML file is open, you can view the locations, measure distances, add new points, or change how things look on the map. You can then save your changes back to the KML file or export it in a different format if you need to use it elsewhere.

KML versus other geographic file formats

KML is one of several formats for storing map data. GeoJSON is another common format, often used for web mapping and data analysis. Shapefile is the standard in professional GIS work and actually consists of multiple files working together. GPX (GPS Exchange Format) is designed specifically for GPS device data like hiking tracks and waypoints.

The main difference is what each format does best. KML is flexible and human-readable, making it good for sharing maps with non-specialists. GeoJSON works well for web applications and programming. Shapefiles handle complex geographic analysis but require multiple files. GPX is optimized for GPS devices and outdoor activities. Most mapping software can convert between these formats, so choosing one usually depends on where you plan to use the data.

When you might need to work with KML files

If you manage location data — for a business with multiple sites, a research project with field locations, or a community mapping effort — KML files let you move that data between tools without starting over. A real estate agent might export property listings from one system as a KML file and import them into a presentation tool. A nonprofit tracking service locations might use KML to share maps with partners or the public.

KML files are also useful for backup and archiving. If you have marked locations in Google Maps or Google Earth, exporting them as a KML file creates a copy you control, separate from the online service. If the service changes or you lose access, you still have your data in a format other programs can read.

Sharing KML files with others

Because KML is a standard format, you can send a KML file to someone else and they can open it in their own mapping software without needing special conversion. This makes KML useful for collaboration. A team working on a project can share location data by emailing a KML file, and each person can open it in whatever mapping program they prefer.

When you share a KML file, all the information you included — location names, descriptions, colors, and styling — comes along with it. The recipient sees the same map you created. They can then edit it, add more locations, or export it in another format if needed.

Frequently Asked Questions

Can I open a KML file in Excel or Google Sheets?

Not directly. KML is designed for mapping software, not spreadsheets. However, you can convert a KML file to CSV (comma-separated values) using online converters or GIS software, and then open the CSV in Excel or Sheets. You will lose the map visualization but keep the location data in table form.

What if I have a KML file but do not have mapping software installed?

Google Earth is free and works on Windows, Mac, and Linux. You can also use Google Maps online — upload your KML file to create a custom map in your browser. Both options require only a web browser or a free download.

Is a KML file the same as a map?

No. A KML file is the data — the locations and information. A map is the visual display of that data. The KML file is what you save and share; the map is what you see when you open it in mapping software.

Can I edit a KML file in a text editor?

Technically yes, since KML is plain text. However, it is not practical unless you understand the KML structure. It is much easier to open the file in mapping software, make your changes visually, and save it back as KML.

Do I need internet to open a KML file?

Not necessarily. Google Earth works offline once installed. Some online mapping tools require internet, but desktop programs like QGIS or ArcGIS can open KML files without a connection. Check your specific software to be sure.