What Is a KML File?

How to open, edit, and convert KML files

What to Know

  • A KML file is a Keyhole Markup Language file.
  • Open one with Google Earth, Merkaartor, or Marble.
  • Convert to KMZ, CSV, GPX, etc., with some of those same programs or MyGeodata.

This article describes what a KML file is, how you can open one, and which programs can convert one to a format that works with other software.

What Is a KML File?

A file with the .KML file extension is a Keyhole Markup Language file. KML files use XML to express geographic annotation and visualization by storing locations, image overlays, video links and modeling information like lines, shapes, 3D images and points.

Various geospatial software programs use KML files, since the purpose is to put the data into a format that other programs and web services can easily use. This included Keyhole Earth Viewer from Keyhole, Inc. before Google acquired the company in 2004 and started using the format with Google Earth.

KML files that open in Google Earth

How to Open KML Files

Google Earth was the first program to be able to view and edit KML files, and it's still one of the most popular ways to open them online. With the web page open, use the Projects menu item (the pin/map icon) to load a KML file from your computer or Google Drive account.

You can also use Google Earth from your desktop. Download Google Earth Pro, and use the File > Open menu to open a KML file.

ArcGIS, Merkaartor, Blender (with the Google Earth Importer plug-in), Global Mapper, and Marble can open KML files as well.

You can import a KML file directly into Google Maps too. This is done through your Google My Maps page when adding content to a new map layer. With the map open, choose Import within any layer to load a KML file from your computer or Google Drive. You can make a new layer with the Add layer button.

Choose a file to import prompt in Google Maps

You can open KML files with any text editor, too, since they're really just plain text XML files. You can use any text editor, like Notepad in Windows or one from this free text editors list. However, doing this will just let you see the text version, which includes coordinates and possibly image references, camera tilt angles, timestamps, etc.

How to Convert a KML File

If you're using the desktop version of Google Earth, right-click the item in the Places section that corresponds to the KML file you opened and that you want to convert to KMZ. Choose Save Place As, and change the Save as type format to be KMZ.

To save a KML file to an ESRI Shapefile (.SHP), GeoJSON, CSV or GPX file, you can use the MyGeodata Converter website. Another KML to CSV converter can be had at ConvertCSV.com. There's also the Filestar desktop KML converter that supports export formats like GDB, GEOJSON, OSM, and TAB.

MyGeodata Converter is only free for the first three conversions. You can get three free ones each month.

To convert a KML file to an ArcGIS layer, follow that link for more information.

If you want to convert your KML file to XML, you don't actually have to do a conversion. Since the format is actually XML (the file is just using the .KML file extension), you can rename .KML to .XML to have it open in your XML viewer.

More Information on the KML Format

KMZ and ETA files are both Google Earth Placemark files. However, KMZ files are just ZIP files that contain a KML file and any other resources, like images, icons, models, overlays, etc. ETA files were used by Earth Viewer and early versions of Google Earth.

As of 2008, KML has been part of an international standard of the Open Geospatial Consortium, Inc. The full KML specification can be seen on Google's KML Reference page.

Still Can't Open It?

If you still can't get your file to open or convert with the programs mentioned above, you might be misreading the file extension. It's possible that you're dealing with a file that really has nothing to do with the KML format.

Another interchangeable geography data format is Geography Markup Language but they use the similarly spelled .GML file extension.

KMR files are not related at all and are instead KnowledgeMill Link files used by the Microsoft Outlook KnowledgeMill Filer plug-in.

Another file format you might be confusing with KML is Korg Trinity/Triton Keymap or Mario Kart Wii Course Description, both of which use the .KMP file extension and open with FMJ-Software's Awave Studio and KMP Modifier, respectively.

LMK files are also different. They are Sothink Logo Maker Image files that you can open with Logo Maker from Sothink.

  • How do you open .KML files in Google Maps?

    Create a new map, and use the Import function to locate and open your .KML file. Google Maps supports .KML files natively like Google Earth.

  • How do you open .KML files in Excel?

    You can't. But if you change a .KML file's extension to .XML, you can open the file with Excel. A simple renaming is all that's necessary, not a proper conversion.

Was this page helpful?