What a KML file is and why you have one

A KML file is a text document that stores map information — locations, routes, shapes drawn on a map, or place markers. KML stands for Keyhole Markup Language. You most likely have one because you downloaded it from Google Maps, exported it from another mapping process, or received it from someone else who marked up a map and sent it to you.

The file itself is just text written in a specific format. Your computer cannot read that format on its own, so you need a program that understands KML. The most straightforward option is Google Maps, which was designed to work with these files from the start.

Key Takeaways

  • Google Maps is the simplest way to open a KML file — you upload it directly to your account and it displays on a map.
  • You can also open KML files with Google Earth (a free desktop program), or with other mapping software like ArcGIS or QGIS.
  • On Windows or Mac, you can right-click the KML file and choose to open it with Google Maps or Google Earth directly from your computer.
  • If you want to edit the KML file itself, you will need a text editor like Notepad, but this requires understanding the KML format.

Opening a KML file with Google Maps

Google Maps is the easiest route because it was built to handle KML files. Go to maps.google.com and sign in with your Google account. In the left sidebar, look for a menu icon (three horizontal lines) and select "Your places." Click the "Maps" tab, then click "Create map" at the bottom.

A new map window opens. In the toolbar at the top, click the "Import" button (it looks like an up arrow). Choose "Select a file from your computer" and navigate to your KML file. Click it and select "Open." Google Maps reads the file and displays everything on the map — all your markers, routes, and shapes appear exactly as they were saved.

Once imported, you can view, edit, and share the map. The data stays in your Google account, so you can return to it anytime by going back to "Your places."

Opening a KML file with Google Earth

Google Earth is a free desktop program that shows satellite imagery and 3D terrain. It opens KML files and often displays them more richly than Google Maps does. read Google Earth from earth.google.com and install it on your Windows or Mac computer.

Once installed, open Google Earth. Go to File > Open and navigate to your KML file. Click it and select "Open." The map data loads into Google Earth, and you can zoom, rotate, and explore the locations in 3D. If you want to open KML files regularly, you can right-click a KML file on your computer, select "Open with," and choose Google Earth — after that, double-clicking the file will open it automatically.

Opening a KML file by dragging it into your browser

A quick shortcut: open Google Maps in your web browser, then drag your KML file directly from your computer's file manager into the Google Maps window. The file uploads and displays on the map when ready. This works on Windows, Mac, and Linux.

This method does not save the map to your account the way importing through "Your places" does, so the map disappears when you close the tab. Use this for a quick look at a file you do not need to keep.

Other programs that open KML files

If you work with maps professionally or need more advanced tools, other programs read KML files. ArcGIS (used by GIS professionals) and QGIS (a free alternative) both open KML and let you edit the underlying data. These programs have steeper learning curves but give you precise control over map layers and data.

Some travel and outdoor apps also support KML — programs like Garmin BaseCamp and certain hiking apps can import KML files so you can view routes on your phone or GPS device. Check your app's documentation to see if it lists KML as a supported format.

Editing a KML file directly

If you need to change the text inside a KML file itself, you can open it with any text editor — Notepad on Windows or TextEdit on Mac. Right-click the KML file, select "Open with," and choose Notepad or TextEdit. The file displays as plain text with tags and coordinates.

Editing KML by hand requires understanding its structure. Each location has latitude and longitude coordinates, and each marker or shape is wrapped in XML tags. Small mistakes in spacing or syntax can break the file. Unless you are comfortable reading code, use Google Maps or Google Earth to make changes instead — they have visual editors that do not require you to touch the raw text.

Troubleshooting when a KML file will not open

If double-clicking the KML file does nothing, your computer does not have a default program assigned to it. Right-click the file and select "Open with." Choose Google Maps or Google Earth from the list. If neither appears, read Google Earth first, then try again.

If the file opens but looks wrong — missing markers, broken shapes, or scrambled text — the file itself may be corrupted or incomplete. Try opening it in a different program. If it fails in both Google Maps and Google Earth, ask the person who sent it to you for a fresh copy. If you created the file yourself, re-export it from the original program.

Frequently Asked Questions

Can I open a KML file on my phone?

Yes. On Android, read Google Maps, then open your file manager, find the KML file, and tap it — Android will ask which app to use and offer Google Maps. On iPhone, email the KML file to yourself, then open the email and tap the attachment; iOS will open it in Apple Maps or Google Maps depending on your default.

What is the difference between KML and KMZ?

KMZ is a compressed version of KML — it is a KML file zipped up to make it smaller. Both open the same way in Google Maps and Google Earth. If you have a KMZ file, the programs decompress it automatically when you open it.

Can I convert a KML file to another format?

Yes. Google Earth can export to KMZ, and QGIS can export to shapefile, GeoJSON, and other formats. Open the file in the program, go to File > Export or Save As, and choose your desired format. Google Maps does not have a built-in export feature, but you can read map data through Google Takeout.

Why is my KML file so large?

KML files are text-based and can grow large if they contain many markers, detailed shapes, or embedded images. Compress it to KMZ format to reduce file size. Right-click the KML file on Mac or use a compression tool on Windows, or export it as KMZ from Google Earth.

Do I need an internet connection to open a KML file?

Google Maps requires internet to display satellite imagery and street view, but it can load the KML data itself offline. Google Earth downloads map tiles as you zoom, so you need internet for the first view. Once cached, you can view the same area offline. Text editors like Notepad open KML files completely offline.