KML and KMZ are map file formats that store location data

KML stands for Keyhole Markup Language. It is a text-based file format that stores geographic information — points, lines, polygons, and other map features — along with labels, descriptions, and styling. KMZ is the compressed version of the same data: a KML file zipped into a single archive, usually smaller and easier to share.

The main difference is practical: KML files are human-readable text that you can open in any text editor, while KMZ files are compressed packages that most mapping applications automatically unpack when you open them. Both formats were originally developed by Google and are now an open standard used across mapping software, GPS devices, and geographic information systems.

You encounter these files when you export map data from Google Maps, Google Earth, or other mapping platforms, or when someone sends you location information they want you to view on a map. They are also common in surveying, urban planning, environmental science, and any field that works with geographic coordinates.

Key Takeaways

  • KML files store map locations, routes, and shapes as readable text; KMZ files are the same data compressed into a single archive.
  • You can open KML files in a text editor to see the raw data, or in mapping software like Google Earth, Google Maps, or ArcGIS to view them visually.
  • KMZ files must be decompressed before you can edit the underlying KML, but most mapping applications handle this automatically when you open them.
  • Both formats preserve location coordinates, descriptions, colors, and other styling information so the map looks the same across different programs.

How KML and KMZ files store location data

A KML file is structured as plain text written in XML, a markup language similar to HTML. Each location, route, or shape is defined by a set of tags that describe what it is and where it sits on the map. A single point might include a latitude and longitude coordinate, a name, and a description. A route might list dozens of coordinates in order. A polygon might define the boundary of a property or region.

The file also stores visual information: the color of a marker, the width of a line, the transparency of a shape, and custom icons. This means when you open the file in different mapping software, the locations and styling travel with it — you do not have to recreate the appearance each time.

A KMZ file is simply a KML file (plus any associated images or files) compressed using standard ZIP compression. When you download a KMZ from Google Earth or another mapping tool, you are getting a package that may contain one or more KML files, image files for custom markers, and other supporting data, all bundled together and compressed to reduce file size.

Opening and viewing KML and KMZ files

The easiest way to view a KML or KMZ file is to open it directly in Google Earth (the free desktop application or web version). Simply drag the file into the window, or use File > Open and select the file. Google Earth will display all the locations, routes, and shapes on an interactive map.

Google Maps also accepts KML and KMZ files, though the process is slightly different. You must import the file through the "Create a new map" feature in Google My Maps, then upload the file. Once imported, you can view and edit the locations on the map.

Other mapping and GIS software that reads these formats includes ArcGIS, QGIS (free and open-source), Garmin BaseCamp (for GPS devices), and many online mapping tools. Most will accept either KML or KMZ without requiring you to manually decompress the KMZ first — the software handles that automatically.

If you want to see the raw data inside a KML file, you can open it in any text editor: Notepad on Windows, TextEdit on Mac, or any code editor. A KMZ file will not open this way — you must decompress it first using a standard ZIP tool (Windows File Explorer, Mac Archive Utility, or any third-party ZIP application).

Creating and exporting KML and KMZ files

Most mapping applications let you export your map data as KML or KMZ. In Google Earth, right-click on a folder or placemark and select "Save Place As" to export as KML. In Google My Maps, click the menu icon next to your map name and select "Export to KML" to download the file.

In ArcGIS and QGIS, you can export any layer or map as KML through the File menu or by right-clicking the layer. Many GPS devices and surveying tools also export directly to KML format, making it a standard way to move location data between different systems.

When you export, the software typically gives you the choice between KML and KMZ. Choose KML if you plan to edit the file in a text editor or need the individual files inside. Choose KMZ if you are sharing the file with others and want a single, compressed package that is easier to email or download.

Editing KML files

You can edit a KML file in a text editor by opening it directly and modifying the coordinates, names, descriptions, and styling tags. This approach works if you are comfortable reading XML and know exactly what you want to change. For example, you could change a marker's color by editing the color code, or update a location's description by editing the text between the description tags.

For most users, editing in mapping software is simpler. Open the KML in Google Earth or Google My Maps, then click on locations to edit their names and descriptions, drag them to new positions, or delete them entirely. When you save, the changes are written back to the KML file.

If you need to edit a KMZ file, you must first decompress it using a ZIP tool, edit the KML inside, then re-compress it back into a KMZ. Most mapping software will do this automatically when you save changes to an imported KMZ file, so you do not have to handle the compression yourself.

When to use KML versus KMZ

Use KML when you need to edit the file in a text editor, when you want to keep individual files separate, or when you are working in a system that expects uncompressed data. KML is also better if you are sharing the file with someone who needs to see or modify the raw data.

Use KMZ when you are sharing the file with others, when file size matters (KMZ is typically 50 to 80 percent smaller), or when you want to bundle multiple related files into a single package. KMZ is also the standard format for sharing maps on Google Earth, since it handles compression and packaging automatically.

In practice, most mapping software accepts both formats interchangeably, so the choice often comes down to convenience. If someone sends you a KMZ and you need to edit it, you can decompress it, edit the KML, and re-compress it — or simply open it in mapping software and edit it there.

Frequently Asked Questions

Can I open a KMZ file in Google Maps?

Google Maps does not directly import KMZ files through the main interface, but Google My Maps does. Create a new map in My Maps, click the import button, and upload your KMZ file. The locations will appear on your custom map, where you can view and edit them.

How do I convert a KML file to KMZ?

Open the KML file in mapping software like Google Earth, then export it as KMZ. Alternatively, compress the KML file using your operating system's ZIP tool or a third-party archive application, then rename the resulting .zip file to .kmz. Most mapping software will recognize it.

What if I receive a KMZ file and cannot open it?

Download and install Google Earth (free), then open the KMZ file with it. If you do not want to install software, decompress the KMZ using your operating system's built-in ZIP tool, then open the resulting KML file in Google My Maps or another online mapping service.

Can I edit a KML file in Excel or a spreadsheet?

Not directly — KML is XML text, not tabular data. However, you can export the coordinates and descriptions from a KML file into a spreadsheet, edit them there, then use a tool or script to convert the spreadsheet back into KML format. Many GIS applications offer this workflow.

Are KML and KMZ files secure to download?

KML and KMZ files contain only location data and text — they cannot execute code or install software. However, always download from trusted sources, just as you would with any file. If a KMZ file came from an unknown sender, decompress it first and inspect the KML file in a text editor before opening it in mapping software.