Which MIME types are related to file extension ".kml"?

The .kml file extension is associated with 3 MIME types:

application/vnd.google-earth.kml+xml, application/vnd.google-earth.kmz, text/xml.

A MIME type is a string that tells browsers and other tools how to handle a particular kind of file.

About .kml Files

KML files are an XML-based format for geographic data.
They store locations, routes, and area information for digital maps and Earth browsers, such as Google Earth.
The MIME type application/vnd.google-earth.kml+xml identifies them as files designed for geospatial use, while text/xml points to their structured text format.
They are often compressed into KMZ files (using MIME type application/vnd.google-earth.kmz) for easier sharing and storage.

Based on information from FilExt.com, KML files are a key tool in geospatial visualization and mapping.

Relationship between file extension and MIME type

A file extension is a suffix at the end of a filename that indicates what type of file it is. File extensions help both users and operating systems identify what application should be used to open the file.

File extensions are typically separated from the filename by a period (dot) and consist of 2-4 characters, though they can be longer. For example, in the filename "document.pdf", ".pdf" is the file extension.

File extensions are closely related to MIME types, as they both serve to identify the format of a file. However, while MIME types are used primarily by web browsers and servers, file extensions are used by operating systems and applications.

Associated MIME types

application/vnd.google-earth.kml+xml, application/vnd.google-earth.kmz, text/xml

FAQs

How do I open a KML file?

You can open KML files primarily with Google Earth Pro (desktop) or Google Earth for Web. Other Geographic Information System (GIS) software like QGIS, ArcGIS, and Global Mapper also fully support this format. For a quick view, you can upload the file to Google My Maps.

What is the difference between KML and KMZ?

A KML file is uncompressed XML text containing geographic data, whereas a KMZ file is a zipped archive. A KMZ file contains the main KML file (usually named doc.kml) along with any associated resources like custom icons, images, or overlays, compressed into a single package for easier sharing.

How can I view a KML file in Google Maps?

You cannot open KML files directly in the standard Google Maps interface; you must use Google My Maps. Go to the Google My Maps website, create a new map, and click the Import layer button to upload your .kml file. Once imported, the data will be visible as a custom layer.

Can I edit a KML file with a text editor?

Yes, because KML is based on XML, you can edit it with any text editor like Notepad, TextEdit, or VS Code. This allows you to manually modify coordinates or styles, though using a visual editor like Google Earth is generally easier for complex shapes.

How do I convert KML to Excel or CSV?

To convert KML data to a spreadsheet, you can use online converters like GPS Visualizer or specialized GIS software. Alternatively, since KML is an XML format, you can use the Get Data > From File > From XML feature in Microsoft Excel to import the structure, though you may need to clean up the data columns afterward.

What is the correct MIME type for serving KML files?

Web servers should be configured to serve these files with the MIME type application/vnd.google-earth.kml+xml. Correctly setting this ensures that browsers prompt the user to open the file in Google Earth rather than displaying it as plain text. You can find more configuration details at mime-type.com.

Why are images missing from my KML file?

If your KML file references images stored locally on your computer, they will not appear when you send the file to someone else. To fix this, you should save the project as a KMZ file, which bundles the KML data and the images together into a single archive.

General FAQ

What is a MIME type?

A MIME (Multipurpose Internet Mail Extensions) type is a standard that indicates the nature and format of a document, file, or assortment of bytes. MIME types are defined and standardized in IETF's RFC 6838.

MIME types are important because they help browsers and servers understand how to process a file. When a browser receives a file from a server, it uses the MIME type to determine how to display or handle the content, whether it's an image to display, a PDF to open in a viewer, or a video to play.

MIME types consist of a type and a subtype, separated by a slash (e.g., text/html, image/jpeg, application/pdf). Some MIME types also include optional parameters.

How do I find the MIME type for a file?

You can check the file extension or use a file identification tool such as file --mime-type on the command line. Many programming languages also provide libraries to detect MIME types.

Why can one extension have multiple MIME types?

Different programs and historical usage may assign various MIME identifiers to the same file format. Listing them together helps maintain compatibility across tools.