A week ago I opened an old .kmz file in google earth to add a few pin-drops. Everything saved correctly and updated for a good 3 days, then I started to get a parsing error in google earth upon opening the file. No idea what this is or how it developed its self, but I know absolutely nothing about how to fix these, I know nothing about programming or coding, and I have tried previous recommendations on the google groups help page with no progress made (https://groups.google.com/forum/#!forum/kml-support-advanced).

I was wondering if there was a detailed list of instructions on how to repair a file?

  • 1
    Can you post the first few lines of the file? If it's a KMZ file you should be able to unzip it and look at the document it contains. The error indicates that it's failing at the first line of the file, which should be an xml definition. – Evil Genius Jul 14 '14 at 15:31
  • I am experiencing a similar problem. When I create the KML file in GIS it converts just fine. When I go to open it in Google Earth I receive a parse error line 4, column 14. I am unfamiliar with coding and have tried to extract the data but end up with a doc.kml. If someone could guide me to fix the parse errors I would greatly appreciate it. – user34554 Jul 15 '14 at 14:04

First a few definitions:

  • KML is a well-formed XML file that conforms to the KML specification.
  • KMZ is ZIP file with .kmz file extension that includes a root .kml file and optionally other kml files, images, or icons.

To fix a .KMZ file simply rename the .kmz file to .zip then unzip the KML file. Fix KML with a text editor.

The first two lines of KML file typically are the XML prolog following by KML root element:

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">

Fix the KML then test the kml file to make sure it views in Google Earth.

Here are some simple steps to fix a KML file.

  1. You can post your KML file to KML validator then use a text editor to fix reported errors.
  2. Or you can use your web browser (rename KML file with .xml extension then drag XML/KML file onto your web browser which will show any basic XML errors).

Additional steps to fix invalid KML files are found here.

Finally repack the kml file back inside the ZIP file and rename again to .kmz

Not the answer you're looking for? Browse other questions tagged or ask your own question.