What a KML file is and why you have one
A KML file is a text document that stores map data — locations, routes, shapes, and labels that you can view on a map. KML stands for Keyhole Markup Language. You most likely have one because you downloaded it from Google Maps, received it from someone else, or exported it from a mapping application. The file itself is just text, but it needs the right program to display the map information inside it.
The most common reason people have KML files is because they saved a custom map from Google Maps or Google Earth. You might also have one if you work with GPS data, real estate boundaries, hiking routes, or any other location-based information that someone shared with you as a KML file.
Key Takeaways
- Google Earth (the free desktop version) opens KML files directly and is the simplest option for most people.
- Google Maps can open KML files through its import feature, though you need a Google account and the file size must be under 100 MB.
- If you do not want to use Google products, free alternatives like QGIS or Marble will open KML files on Windows, Mac, or Linux.
- You can also open a KML file in a text editor to see the raw data inside, though this shows code rather than a visual map.
Opening a KML file with Google Earth
Google Earth is the fastest way to view a KML file. Download the free desktop version from google.com/earth — it works on Windows, Mac, and Linux. Once installed, open Google Earth and go to File > Open. Navigate to your KML file and click Open. The map will load immediately, and you can zoom, pan, and explore the locations stored in the file.
If the KML file is already on your computer, you can also double-click it directly. On most systems, this will automatically open it in Google Earth if Google Earth is installed. If nothing happens when you double-click, right-click the file, select "Open with", and choose Google Earth from the list.
Opening a KML file with Google Maps
Google Maps can import KML files, but the process is slightly different from Google Earth. Go to google.com/maps in your web browser and sign in with your Google account. Click the menu icon (three horizontal lines) in the top left, then select "Your places". Click the "Maps" tab, then click "Create map". In the new map window, click "Import" and select your KML file from your computer.
Google Maps has a file size limit of 100 MB, so very large KML files will not import. If your file is too large, Google Earth is a better choice. Once imported, the map data will appear on your custom map, and you can add notes, share it with others, or edit the locations directly in Google Maps.
Using free mapping software as an alternative
QGIS is a free, professional-grade mapping program that opens KML files on Windows, Mac, and Linux. Download it from qgis.org. Open QGIS, go to Layer > Add Layer > Add Vector Layer, select your KML file, and click Open. QGIS shows more technical detail than Google Earth and is useful if you need to analyze or edit the geographic data.
Marble is another free option that works similarly to Google Earth. It is lighter weight and does not require a Google account. Download it from marble.kde.org, open the program, and use File > Open to load your KML file. Both QGIS and Marble are good choices if you prefer not to use Google products or if you need more control over how the map is displayed.
Opening a KML file in a text editor
A KML file is actually a text file written in XML format, so you can open it in any text editor — Notepad on Windows, TextEdit on Mac, or any other plain-text editor. Right-click the KML file, select "Open with", and choose your text editor. You will see the raw code that makes up the map data, including coordinates, place names, and styling information.
This approach is useful if you need to check what data is inside the file or if you want to edit the code directly. Most people do not need to do this — viewing the file in Google Earth or Google Maps is much easier. But if you are troubleshooting a problem or need to make small changes to the data, opening it in a text editor lets you see exactly what you are working with.
Troubleshooting when a KML file will not open
If double-clicking the KML file does nothing, the file type may not be associated with any program on your computer. Right-click the file and select "Open with" or "Open with > Choose another app". Select Google Earth, Google Maps, or another mapping program from the list. If you do not see any mapping programs, you need to download one first — Google Earth is the easiest starting point.
If you see an error message when trying to open the file, the KML file itself may be corrupted or incomplete. Try opening it in a text editor first to see if the file contains readable text. If the file is empty or shows only garbled characters, it may not have downloaded correctly. Try downloading it again from the source. If the file opens in a text editor but not in a mapping program, the XML code inside may be malformed — contact whoever sent you the file and ask for a fresh copy.
Moving or sharing a KML file
KML files are small and portable. You can email them, store them on a USB drive, or upload them to cloud storage like Google Drive or Dropbox. The file will work the same way on any computer, as long as that computer has a program that can open it. If you are sending a KML file to someone else, let them know they will need Google Earth, Google Maps, or another mapping program to view it.
If you want to edit a KML file and save your changes, use Google Maps or QGIS rather than a text editor. Both programs let you modify the map data and export it back as a KML file. This is much safer than editing the XML code by hand, which can break the file if you make a mistake.
Frequently Asked Questions
Can I open a KML file on my phone?
Yes. On Android, download Google Earth from the Google Play Store, then open the app and tap the menu icon. Select "Import KML file" and choose the file from your phone's storage. On iPhone, Google Earth works the same way. You can also open KML files in Google Maps on either phone by importing them through the web version first, then viewing them in the mobile app.
What is the difference between KML and KMZ?
A KMZ file is a compressed version of a KML file — it is a KML file that has been zipped up to make it smaller. Both open the same way in Google Earth and Google Maps. If you have a KMZ file, you can open it directly in these programs just like a KML file. Some programs will automatically unzip it for you.
Can I convert a KML file to another format?
Yes. QGIS can open a KML file and export it as a shapefile, GeoJSON, or other formats. Right-click the layer in QGIS, select "Export as", and choose your desired format. Google Earth does not have a built-in export feature, but you can copy the data from Google Earth into Google Maps and then export it from there.
Why is my KML file so large?
KML files can be large if they contain many locations, detailed shapes, or embedded images. If your file is over 100 MB, Google Maps will not import it, but Google Earth and QGIS will still open it. You can also try opening the file in a text editor and removing unnecessary data if you know what you are looking for.
Do I need an internet connection to open a KML file?
Google Earth works offline once it is installed, so you can open KML files without internet. Google Maps requires an internet connection because it runs in your web browser. QGIS and Marble also work offline. If you are in an area without internet, Google Earth or QGIS are your best options.