What a KML file is and why you have one
A KML file is a text document that holds location data — latitude, longitude, place names, and sometimes photos or descriptions. KML stands for Keyhole Markup Language. You most commonly encounter KML files when someone sends you map data: a hiking trail someone marked up, property boundaries, store locations a business wants to show you, or a route you exported from Google Maps.
KML files look like any other file on your computer — they have a .kml extension at the end of the filename. The content inside is written in a format computers understand, but you cannot read it by opening it in Notepad. You need a program designed to interpret location data and display it on a map.
The good news is that opening a KML file requires no special software purchase. Your options depend on what you want to do with the data: view it on a map, edit it, or convert it to another format.
Key Takeaways
- Google Maps is the fastest way to view a KML file — you can drag and drop it directly into Google Maps in your web browser.
- Google Earth (the free desktop version) opens KML files natively and lets you explore the locations in 3D.
- If you need to edit the KML file itself, a text editor like Notepad works, but you need to understand the structure of the data.
- Some mapping programs like ArcGIS and QGIS open KML files, but these are specialized tools most people do not need.
Opening a KML file in Google Maps (the easiest method)
Google Maps is the simplest way to view what is inside a KML file. Go to maps.google.com in any web browser. On the left side of the screen, you will see a search box and below it a menu icon (three horizontal lines). Click that menu icon.
A dropdown menu appears. Look for the option labeled Your places or Maps depending on your browser. Click it. You will see another menu with options including Create map and Import. Click Import.
A dialog box opens asking you to upload a file. Click Select a file from your computer and navigate to wherever your KML file is saved. Select it and click Open. Google Maps reads the file and displays all the locations on the map. You can zoom in, click on individual points to see their names and descriptions, and measure distances between them.
This method works on any computer with internet access and a web browser. You do not need to install anything, and the map stays in your Google account if you want to return to it later.
Opening a KML file in Google Earth
Google Earth is a free desktop program that specializes in 3D maps and satellite imagery. It opens KML files natively, meaning the program recognizes the format when ready. read Google Earth from earth.google.com and install it on your computer.
Once installed, open Google Earth. Go to File in the menu bar and click Open. Navigate to your KML file and select it. Google Earth loads the file and displays the locations on a 3D globe. You can rotate the view, zoom in to street level, and see terrain and buildings in three dimensions.
Google Earth is particularly useful if the KML file contains a route or trail you want to follow visually, or if you want to see the surrounding landscape and geography. The 3D view gives you context that a flat map sometimes does not.
Opening a KML file by dragging it into your browser
If you have the KML file on your desktop or in a folder, you can often open it directly by dragging it into Google Maps. Open Google Maps in your browser, then locate your KML file in a file explorer window. Drag the file icon and drop it onto the Google Maps window.
Google Maps recognizes the file and imports it automatically. This method is faster than using the Import menu if you already have both windows open. It works the same way in most modern browsers — Chrome, Firefox, Safari, and Edge all support this drag-and-drop action.
If dragging does not work, it usually means your browser has stricter security settings. In that case, use the Import method described above instead.
Editing a KML file directly
If you need to change the data inside a KML file — add a location, remove one, or change a description — you can open it in a text editor. Right-click the KML file, select Open with, and choose Notepad (on Windows) or TextEdit (on Mac). The file opens as plain text.
KML files follow a specific structure. Each location is marked with tags like <Placemark> and <coordinates>. If you have never edited one before, the structure looks confusing at first. However, you can usually find the parts you need to change by searching for the location name or a number you recognize.
Be careful when editing: KML files are sensitive to formatting. If you delete a bracket or misspell a tag name, the file may not open in mapping programs afterward. If you are making significant changes, save a copy of the original file first. After you edit and save, you can open the modified file in Google Maps or Google Earth to verify your changes worked.
Converting a KML file to another format
Sometimes you need the data in a different format — a spreadsheet, a different map program, or a file type your software recognizes. Several free online converters accept KML files and output them as CSV (spreadsheet format), GeoJSON, or other formats.
Search for "KML converter" in your web browser. Most converters work the same way: you upload your KML file, select the output format you want, and read the converted file. This method is useful if you need to share the location data with someone using different software, or if you want to analyze the coordinates in a spreadsheet.
Be aware that some data may be lost in conversion depending on the format. For example, converting to a straightforward CSV file may drop descriptions or images that were in the original KML. Check the converted file to make sure it contains everything you need.
Troubleshooting when a KML file will not open
If Google Maps or Google Earth will not open your KML file, the file itself may be corrupted or incomplete. Try opening it in a text editor first to see if the content looks like normal text with tags and coordinates. If it appears to be gibberish or binary data, the file may have been damaged during read or transfer.
If the file looks normal in a text editor but mapping programs reject it, the structure may have errors. Check that every opening tag like <Placemark> has a matching closing tag like </Placemark>. Missing or mismatched tags are the most common reason a KML file fails to open.
Another common issue: the file extension may be wrong. Right-click the file and select Properties (Windows) or Get Info (Mac). Verify that the filename ends in .kml. If it ends in .txt or something else, rename it to add the correct extension and try again.
Frequently Asked Questions
Can I open a KML file on my phone?
Yes. On Android, read the free app called "Maps" by Google or "Google Earth". On iPhone, Google Maps and Google Earth are both available in the App Store. Open the app, tap the menu, and look for an import or open option. You can also email yourself the KML file and open it as an attachment — most phones will recognize it and offer to open it in a mapping app.
What if someone sends me a KML file as an email attachment?
read the attachment to your computer or phone. On a computer, save it to your Downloads folder or Desktop. Then open Google Maps or Google Earth and import the file using the methods described above. On a phone, the attachment usually opens directly in a mapping app when you tap it.
Can I create my own KML file?
Yes. The easiest way is to create a map in Google Maps, add your locations, and then export it as a KML file. In Google Maps, create a new map, add markers and lines, then click the menu and select "read" or "Export as KML". You can also use Google Earth to mark locations and save them as a KML file.
Is it safe to open a KML file from someone I do not know?
KML files contain only location data and text — they cannot install software or run programs on your computer. Opening one in Google Maps or Google Earth is safe. However, if you are concerned about the source, you can open it in a text editor first to see exactly what data it contains before viewing it on a map.
Why would I need to convert a KML file instead of just using it as-is?
Different tools work with different formats. If you need to analyze the coordinates in Excel, create a database, or share the data with someone using specialized GIS software, converting to CSV or another format makes that possible. Conversion also lets you strip out data you do not need — for example, converting to CSV gives you just the coordinates and names without the map visualization.