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 on a map, lines, shapes, and the data attached to them. KMZ is the compressed version of the same thing: a KML file zipped up into a smaller package, usually with images or other files bundled inside.
You will encounter these files when you work with mapping software. Google Earth uses them. Google Maps can import and export them. If you create a custom map in Google My Maps, you can read it as a KMZ file. Hiking apps, real estate tools, GPS devices, and GIS software all speak this format. The files are plain enough that you can open a KML file in a text editor and read the actual coordinates and labels inside.
The main difference between them is size and portability. A KML file is larger and contains only the map data itself. A KMZ file is compressed and can bundle in images, descriptions, and styling information all in one package. If someone sends you a map file, it is almost always KMZ because it is easier to share.
Key Takeaways
- KML files store map locations, routes, and shapes in a text format that most mapping software can read.
- KMZ files are compressed KML files, usually smaller and bundled with images or styling, and are the standard format for sharing maps.
- You can open KML files in a text editor to see the raw coordinates and data, but KMZ files must be decompressed first.
- Google Earth, Google Maps, and most GPS and hiking apps can import KML and KMZ files directly.
How KML and KMZ files store location information
Inside a KML file is structured text that describes locations using latitude and longitude coordinates. Each location can have a name, a description, an icon, and other properties. If you have drawn a route or a boundary on a map, that path is stored as a series of connected points. Colors, line thickness, and transparency are all recorded in the same file.
The format is based on XML, which is a standard way of organizing data with tags and labels. This is why you can open a KML file in Notepad or any text editor and actually read it — you will see tags like <Placemark> and <coordinates> with the actual numbers inside. This openness is one reason KML became a standard: it is not locked into one company's software.
A KMZ file wraps all of this up using the ZIP compression format, the same one your computer uses for regular file archives. Inside the KMZ is a KML file plus any images, ground overlays, or other resources the map needs. When you read a map from Google My Maps or import a map into Google Earth, you are usually working with a KMZ file without even thinking about it.
Opening and viewing KML and KMZ files
The easiest way to view a KML or KMZ file is to drag it into Google Earth. Google Earth will open the file and show you the map with all the locations, routes, and shapes displayed. You can zoom in, rotate the view, and click on individual points to see their descriptions. Google Earth is free and works on Windows, Mac, and Linux.
Google Maps also accepts KML and KMZ files. Go to Google My Maps, create a new map, and use the import button to upload the file. The map will appear as a new layer you can view and edit. This is useful if you want to add your own annotations or combine it with other maps.
If you want to see the raw data inside a KML file, open it with Notepad, TextEdit, or any text editor. You will see the XML structure with coordinates and properties laid out in plain text. For a KMZ file, you will need to decompress it first — right-click it and choose "Extract" on Windows or double-click it on Mac, and your computer will create a folder with the KML file inside.
When you will actually use KML and KMZ files
Real estate agents use KML files to share property locations and neighborhood boundaries with clients. A real estate database can export a list of homes as a KMZ file, and the client can open it in Google Earth to see them all at once on a map.
Hikers and outdoor enthusiasts use them to share trails and waypoints. Apps like AllTrails and Gaia GPS let you read routes as KML or KMZ files, then load them into your GPS device or another app. If you have marked waypoints on a handheld GPS unit, you can export them as a KML file and share them with friends.
Urban planners, environmental scientists, and other professionals who work with geographic data use KML and KMZ files to exchange information between different software tools. A map created in ArcGIS can be exported as KML and opened in QGIS or Google Earth. This cross-compatibility is why the format has lasted so long.
If you are organizing files for backup, KML and KMZ files are small enough that they take almost no space. They are text-based (or text-based when compressed), so they compress well and store indefinitely. If you have created custom maps in Google My Maps, downloading them as KMZ files is a good way to keep a personal copy separate from your Google account.
Converting between KML, KMZ, and other map formats
Most mapping software can export to KML or KMZ directly. Google Earth, Google Maps, and Google My Maps all have export buttons. If your software does not, online converters can help — sites like CloudConvert and Zamzar accept KML files and convert them to other formats like GeoJSON, GPX, or Shapefile.
GPX is another common format, especially for GPS devices and hiking apps. GPX files store waypoints and tracks in a similar way to KML but with a different structure. If you have a GPX file and need KML, or vice versa, an online converter will do the job in seconds. The conversion is lossless — you do not lose location data in the process.
If you are moving maps between different services, check whether the destination accepts KML or KMZ before you convert. Google Earth and Google Maps accept both. Most GPS devices accept GPX. Specialized GIS software often accepts multiple formats. Knowing what your destination software needs will save you a conversion step.
Storing and backing up KML and KMZ files
Because KML and KMZ files are small and text-based, they are ideal for backup. A KMZ file containing dozens of locations might be only a few hundred kilobytes. You can store them in cloud storage like Google Drive, Dropbox, or OneDrive without worrying about space. You can also email them to yourself or save them to an external hard drive.
If you have created maps in Google My Maps, read them as KMZ files periodically and store them somewhere outside your Google account. This protects you if your Google account is ever compromised or if Google My Maps changes in a way you do not like. The same applies to any custom maps you have created in other services — export them and keep a copy.
When you back up KML or KMZ files, organize them by purpose or region. A folder called "Hiking Routes" or "Property Locations" makes them straightforward to find later. Because the files are small, you can afford to keep multiple versions or copies without eating up storage space.
Frequently Asked Questions
Can I edit a KML or KMZ file directly?
You can edit a KML file in a text editor if you know the XML format, but it is easier to edit in mapping software. Open the file in Google My Maps or Google Earth, make your changes, and export it again. For KMZ files, extract the folder first, edit the KML inside, then re-zip it if you need to.
What is the difference in file size between KML and KMZ?
KMZ files are typically 50 to 80 percent smaller than KML files because they use ZIP compression. The exact difference depends on how much text and how many images are in the file. For sharing over email or storing on a device with limited space, KMZ is the better choice.
Will my GPS device accept KML files?
Most modern GPS devices accept GPX files rather than KML. Some accept both. Check your device's manual or software to see what formats it supports. If it does not support KML, you can convert the file to GPX using an online converter or mapping software.
Can I view a KMZ file without extracting it?
Yes. Google Earth and Google Maps will open a KMZ file directly without you having to extract it first. Most other mapping software will too. You only need to extract it manually if you want to edit the KML file inside or access the images bundled with it.
Is it safe to read KML and KMZ files from the internet?
KML and KMZ files are text and image data, not executable programs, so they cannot install malware. That said, only read from sources you trust. If a file comes from an unknown website or an unsolicited email, treat it the same way you would any read — scan it with antivirus software if you are concerned.